1
1
#! /usr/bin/env groovy
2
2
3
- pipeline {
4
-
5
- agent any
6
- options {
7
- buildDiscarder(logRotator(numToKeepStr :' 10' ))
8
- skipDefaultCheckout()
9
- }
10
- tools{
11
- maven ' apache-maven-latest'
12
- jdk ' jdk1.8.0-latest'
13
- }
14
- stages {
3
+ final def mavenOpts = ' -B -T 1C -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
15
4
16
- stage(' Checkout git repository' ) {
17
- steps {
18
- echo ' Cleaning Workspace'
19
- cleanWs()
20
- echo ' Checking out keti repo'
21
- dir (' keti' ) {
22
- checkout scm
23
- }
24
- sh ' mkdir public && cp -frp keti public/keti'
25
- sh ' mkdir public-graph && cp -frp keti public-graph/keti'
26
- }
27
- post {
28
- success {
29
- echo ' Checkout of the Git repository succeeded'
30
- }
31
- failure {
32
- echo ' Checkout of the Git repository failed'
33
- }
34
- }
35
- }
36
-
37
- stage(' Build Public Profile' ) {
38
- steps {
39
- sh ' cd public/keti && mvn clean install -P public'
40
- }
41
- post {
42
- success {
43
- echo ' Build Public profile succeeded'
44
- }
45
- failure {
46
- echo ' Build Public profile failed'
47
- }
48
- always {
49
- junit ' **/public/**/surefire-reports*/junitreports/TEST*.xml, **/public/**/surefire-reports*/**/junitreports/TEST*.xml'
50
- }
51
- }
52
- }
5
+ pipeline {
6
+ agent any
7
+ options {
8
+ buildDiscarder(logRotator(numToKeepStr :' 10' ))
9
+ skipDefaultCheckout()
10
+ }
11
+ tools {
12
+ maven ' apache-maven-latest'
13
+ jdk ' jdk1.8.0-latest'
14
+ }
15
+ stages {
16
+ stage(' Checkout Git repositories' ) {
17
+ failFast true
18
+ parallel {
19
+ stage(' Pull request' ) {
20
+ when {
21
+ changeRequest()
22
+ }
23
+ steps {
24
+ dir(' keti' ) {
25
+ checkout(
26
+ [ $class : ' GitSCM' ,
27
+ branches : [ [ name : env. CHANGE_BRANCH ] ],
28
+ doGenerateSubmoduleConfigurations : false ,
29
+ extensions : [ [ $class : ' SubmoduleOption' ,
30
+ disableSubmodules : false ,
31
+ parentCredentials : true ,
32
+ recursiveSubmodules : true ,
33
+ reference : ' ' ,
34
+ trackingSubmodules : true ] ],
35
+ submoduleCfg : [ ],
36
+ userRemoteConfigs : [ [ credentialsId : ' 670c4a5c-7db1-4a51-9706-e49458224cda' ,
37
+ url : ' https://github.com/eclipse/keti' ] ] ]
38
+ )
39
+ }
40
+ }
41
+ }
42
+ stage(' Non-pull-request' ) {
43
+ when {
44
+ not {
45
+ changeRequest()
46
+ }
47
+ }
48
+ steps {
49
+ dir(' keti' ) {
50
+ checkout(
51
+ [ $class : ' GitSCM' ,
52
+ branches : [ [ name : env. BRANCH_NAME ] ],
53
+ doGenerateSubmoduleConfigurations : false ,
54
+ extensions : [ [ $class : ' SubmoduleOption' ,
55
+ disableSubmodules : false ,
56
+ parentCredentials : true ,
57
+ recursiveSubmodules : true ,
58
+ reference : ' ' ,
59
+ trackingSubmodules : true ] ],
60
+ submoduleCfg : [ ],
61
+ userRemoteConfigs : [ [ credentialsId : ' 670c4a5c-7db1-4a51-9706-e49458224cda' ,
62
+ url : ' https://github.com/eclipse/keti' ] ] ]
63
+ )
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
69
+ stage(' Run post-SCM-checkout operations' ) {
70
+ steps {
71
+ sh '''
72
+ ls -altr keti keti/kotlin
53
73
54
- stage(' Build Public Graph Profile' ) {
55
- steps {
56
- sh ' cd public-graph/keti && mvn clean install -P public-graph'
57
- }
58
- post {
59
- success {
60
- echo ' Build Public Graph Profile succeeded'
61
- }
62
- failure {
63
- echo ' Build Public Graph Profile failed'
64
- }
65
- always {
66
- junit ' **/public-graph/**/surefire-reports*/junitreports/TEST*.xml, **/public-graph/**/surefire-reports*/**/junitreports/TEST*.xml'
67
- }
68
- }
69
- }
74
+ rm -rf public
75
+ mkdir public
76
+ cp -a keti public/keti
70
77
71
- stage(' Run Integration tests using Public Profile' ) {
72
- steps {
73
- sh " cd public/keti && ./run-integration-tests.sh"
74
- }
75
- post {
76
- success {
77
- echo ' Run Integration tests using Public Profile succeeded'
78
- }
79
- failure {
80
- echo ' Run Integration tests using Public Profile failed'
81
- }
82
- always {
83
- junit ' **/public/**/failsafe-reports*/junitreports/TEST*.xml, **/public/**/failsafe-reports*/**/junitreports/TEST*.xml'
84
- }
85
- }
86
- }
78
+ rm -rf public-kt
79
+ mkdir public-kt
80
+ cp -a keti public-kt/keti
87
81
88
- stage(' Run Integration tests using Public Graph Profile' ) {
89
- steps {
82
+ rm -rf public-graph
83
+ mkdir public-graph
84
+ cp -a keti public-graph/keti
90
85
91
- sh " cd public-graph/keti && ./run-integration-tests.sh -g"
92
- }
93
- post {
94
- success {
95
- echo ' Run Integration tests using Public Graph Profile succeeded'
96
- }
97
- failure {
98
- echo ' Run Integration tests using Public Graph Profile failed'
99
- }
100
- always {
101
- junit ' **/public-graph/**/failsafe-reports*/junitreports/TEST*.xml, **/public-graph/**/failsafe-reports*/**/junitreports/TEST*.xml'
102
- }
103
- }
104
- }
105
- }
106
- }
86
+ rm -rf public-graph-kt
87
+ mkdir public-graph-kt
88
+ cp -a keti public-graph-kt/keti
89
+ '''
90
+ }
91
+ }
92
+ stage(' Build and run unit tests' ) {
93
+ failFast true
94
+ parallel {
95
+ stage(" Build the 'public' Maven profile (Java)" ) {
96
+ steps {
97
+ sh " cd public/keti && mvn clean package install ${ mavenOpts} -P public -D maven.repo.local=${ env.WORKSPACE} /m2-public"
98
+ }
99
+ }
100
+ stage(" Build the 'public' Maven profile (Kotlin)" ) {
101
+ steps {
102
+ sh " cd public-kt/keti/kotlin && mvn clean package install ${ mavenOpts} -P public -D maven.repo.local=${ env.WORKSPACE} /m2-public-kt"
103
+ }
104
+ }
105
+ stage(" Build the 'public-graph' Maven profile (Java)" ) {
106
+ steps {
107
+ sh " cd public-graph/keti && mvn clean package install ${ mavenOpts} -P public-graph -D maven.repo.local=${ env.WORKSPACE} /m2-public-graph"
108
+ }
109
+ }
110
+ stage(" Build the 'public-graph' Maven profile (Kotlin)" ) {
111
+ steps {
112
+ sh " cd public-graph-kt/keti/kotlin && mvn clean package install ${ mavenOpts} -P public-graph -D maven.repo.local=${ env.WORKSPACE} /m2-public-graph-kt"
113
+ }
114
+ }
115
+ }
116
+ post {
117
+ always {
118
+ junit testResults : ' **/public*/**/surefire-reports*/junitreports/TEST*.xml, **/public*/**/surefire-reports*/**/junitreports/TEST*.xml' , allowEmptyResults : true
119
+ }
120
+ }
121
+ }
122
+ stage(' Run integration tests' ) {
123
+ failFast true
124
+ parallel {
125
+ stage(" Run integration tests using the 'public' Maven profile (Java)" ) {
126
+ steps {
127
+ sh " cd public/keti && PORT_OFFSET=10 source ./set-env-local.sh && cd acs-integration-tests && mvn clean verify ${ mavenOpts} -P public -D maven.repo.local=${ env.WORKSPACE} /m2-public"
128
+ }
129
+ }
130
+ stage(" Run integration tests using the 'public' Maven profile (Kotlin)" ) {
131
+ steps {
132
+ sh " cd public-kt/keti/kotlin && PORT_OFFSET=20 source ./set-env-local.sh && cd acs-integration-tests && mvn clean verify ${ mavenOpts} -P public -D maven.repo.local=${ env.WORKSPACE} /m2-public-kt"
133
+ }
134
+ }
135
+ stage(" Run integration tests using the 'public-graph' Maven profile (Java)" ) {
136
+ steps {
137
+ sh " cd public-graph/keti && PORT_OFFSET=30 source ./set-env-local.sh && cd acs-integration-tests && mvn clean verify ${ mavenOpts} -P public-graph -D maven.repo.local=${ env.WORKSPACE} /m2-public-graph"
138
+ }
139
+ }
140
+ stage(" Run integration tests using the 'public-graph' Maven profile (Kotlin)" ) {
141
+ steps {
142
+ sh " cd public-graph-kt/keti/kotlin && PORT_OFFSET=40 source ./set-env-local.sh && cd acs-integration-tests && mvn clean verify ${ mavenOpts} -P public-graph -D maven.repo.local=${ env.WORKSPACE} /m2-public-graph-kt"
143
+ }
144
+ }
145
+ }
146
+ post {
147
+ always {
148
+ junit testResults : ' **/public*/**/failsafe-reports*/junitreports/TEST*.xml, **/public-*/**/failsafe-reports*/**/junitreports/TEST*.xml' , allowEmptyResults : true
149
+ }
150
+ }
151
+ }
152
+ }
153
+ post {
154
+ always {
155
+ cleanWs()
156
+ }
157
+ }
158
+ }
0 commit comments