Skip to main content
summaryrefslogtreecommitdiffstats
blob: 5285bd023c48f8cdd93bb885a70dfeaf95d32cf3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
pipeline {
    agent any
    tools { 
        maven 'apache-maven-latest'
        jdk 'jdk1.8.0-latest'
    }
    
    stages {
        stage ('prepare') {
			steps {
				cleanWs()
				checkout scm
			}
        }
        stage ('build') {
            steps {
                sh 'mvn -version'
                sh 'java -version'
                sh 'mvn -f dev/pom.xml -B clean install site -DskipTests'
            }			
        }

        stage ('test') {
            steps {
                sh 'mvn -version'
                sh 'java -version'
                sh 'mvn -f dev/pom.xml -B test -Dcheckstyle.skip=true -Dfindbugs.skip=true -Dpmd.skip=true'
                junit allowEmptyResults: true, testResults: '**/surefire-reports/TEST*.xml'
                jacoco()
            }			
        }
		
		stage("Publish Checkstyle & PMD & Findbugs Results"){
			steps {
				checkstyle canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '**/checkstyle-result*.xml', unHealthy: '', unstableTotalAll:'0'
				pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '**/target/pmd.xml', unHealthy: '', unstableTotalAll:'0'
				findbugs canComputeNew: false, defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', pattern: '**/findbugsXml.xml', unHealthy: '', unstableTotalAll:'0'
			}
		}
		
		stage("Publish Checkstyle & PMD & Findbugs Results"){
			steps {
				sh 'mvn -f dev/pom.xml -B clean install site -DskipTests'
			}
		}
		
		stage ('deploy snapshot') {
			when {
				 branch 'develop'
			}
			steps {
                sh 'mvn  -f dev/pom.xml -B deploy -DskipTests -Dcheckstyle.skip=true -Dfindbugs.skip=true -Dpmd.skip=true -DaltDeploymentRepository=repo.eclipse.org::default::https://repo.eclipse.org/content/repositories/openk-platform-snapshots/'
            }
		}
		
		stage ('deploy releases') {
			when {
				 branch 'master'
			}
			steps {
                sh 'mvn  -f dev/pom.xml -B deploy -DskipTests -Dcheckstyle.skip=true -Dfindbugs.skip=true -Dpmd.skip=true -DaltDeploymentRepository=repo.eclipse.org::default::https://repo.eclipse.org/content/repositories/openk-platform-releases/'
            }
		}
    }
}

Back to the top