1
+ def p = [:]
2
+ node {
3
+ checkout scm
4
+ p = readProperties interpolate : true , file : ' ci/pipeline.properties'
5
+ }
6
+
1
7
pipeline {
2
8
agent none
3
9
@@ -13,60 +19,7 @@ pipeline {
13
19
}
14
20
15
21
stages {
16
- stage(" Docker images" ) {
17
- parallel {
18
- stage(' Publish JDK 8 + MongoDB 4.4' ) {
19
- when {
20
- changeset " ci/openjdk8-mongodb-4.4/**"
21
- }
22
- agent { label ' data' }
23
- options { timeout(time : 30 , unit : ' MINUTES' ) }
24
-
25
- steps {
26
- script {
27
- def image = docker. build(" springci/spring-data-rest-openjdk8-with-mongodb-4.4" , " ci/openjdk8-mongodb-4.4/" )
28
- docker. withRegistry(' ' , ' hub.docker.com-springbuildmaster' ) {
29
- image. push()
30
- }
31
- }
32
- }
33
- }
34
- stage(' Publish JDK 11 + MongoDB 4.4' ) {
35
- when {
36
- changeset " ci/openjdk11-mongodb-4.4/**"
37
- }
38
- agent { label ' data' }
39
- options { timeout(time : 30 , unit : ' MINUTES' ) }
40
-
41
- steps {
42
- script {
43
- def image = docker. build(" springci/spring-data-rest-openjdk11-with-mongodb-4.4" , " ci/openjdk8-mongodb-4.4/" )
44
- docker. withRegistry(' ' , ' hub.docker.com-springbuildmaster' ) {
45
- image. push()
46
- }
47
- }
48
- }
49
- }
50
- stage(' Publish JDK 17/ + MongoDB 4.4' ) {
51
- when {
52
- changeset " ci/openjdk17-mongodb-4.4/**"
53
- }
54
- agent { label ' data' }
55
- options { timeout(time : 30 , unit : ' MINUTES' ) }
56
-
57
- steps {
58
- script {
59
- def image = docker. build(" springci/spring-data-rest-openjdk17-with-mongodb-4.4" , " ci/openjdk17-mongodb-4.4/" )
60
- docker. withRegistry(' ' , ' hub.docker.com-springbuildmaster' ) {
61
- image. push()
62
- }
63
- }
64
- }
65
- }
66
- }
67
- }
68
-
69
- stage(" test: baseline (jdk8)" ) {
22
+ stage(" test: baseline (main)" ) {
70
23
when {
71
24
beforeAgent(true )
72
25
anyOf {
@@ -79,12 +32,12 @@ pipeline {
79
32
}
80
33
options { timeout(time : 30 , unit : ' MINUTES' ) }
81
34
environment {
82
- ARTIFACTORY = credentials(' 02bd1690-b54f-4c9f-819d-a77cb7a9822c ' )
35
+ ARTIFACTORY = credentials(" ${ p['artifactory.credentials'] } " )
83
36
}
84
37
steps {
85
38
script {
86
- docker. withRegistry(' ' , ' hub. docker.com-springbuildmaster ' ) {
87
- docker. image(' springci/spring-data-rest-openjdk8- with-mongodb-4.4:latest ' ). inside(' -v $HOME:/tmp/jenkins-home ' ) {
39
+ docker. withRegistry(p[ ' docker.registry ' ], p[ ' docker.credentials ' ] ) {
40
+ docker. image(" springci/spring-data-with-mongodb-4.4:${ p['java.main.tag'] } " ). inside(p[ ' docker.java.inside.basic ' ] ) {
88
41
sh ' mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
89
42
sh ' mongod --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &'
90
43
sh ' sleep 10'
@@ -106,18 +59,18 @@ pipeline {
106
59
}
107
60
}
108
61
parallel {
109
- stage(" test: baseline (jdk11 )" ) {
62
+ stage(" test: baseline (next )" ) {
110
63
agent {
111
64
label ' data'
112
65
}
113
66
options { timeout(time : 30 , unit : ' MINUTES' ) }
114
67
environment {
115
- ARTIFACTORY = credentials(' 02bd1690-b54f-4c9f-819d-a77cb7a9822c ' )
68
+ ARTIFACTORY = credentials(" ${ p['artifactory.credentials'] } " )
116
69
}
117
70
steps {
118
71
script {
119
- docker. withRegistry(' ' , ' hub. docker.com-springbuildmaster ' ) {
120
- docker. image(' springci/spring-data-rest-openjdk11- with-mongodb-4.4:latest ' ). inside(' -v $HOME:/tmp/jenkins-home ' ) {
72
+ docker. withRegistry(p[ ' docker.registry ' ], p[ ' docker.credentials ' ] ) {
73
+ docker. image(" springci/spring-data-with-mongodb-4.4:${ p['java.next.tag'] } " ). inside(p[ ' docker.java.inside.basic ' ] ) {
121
74
sh ' mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
122
75
sh ' mongod --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &'
123
76
sh ' sleep 10'
@@ -135,12 +88,12 @@ pipeline {
135
88
}
136
89
options { timeout(time : 30 , unit : ' MINUTES' ) }
137
90
environment {
138
- ARTIFACTORY = credentials(' 02bd1690-b54f-4c9f-819d-a77cb7a9822c ' )
91
+ ARTIFACTORY = credentials(" ${ p['artifactory.credentials'] } " )
139
92
}
140
93
steps {
141
94
script {
142
- docker. withRegistry(' ' , ' hub. docker.com-springbuildmaster ' ) {
143
- docker. image(' springci/spring-data-rest-openjdk17- with-mongodb-4.4:latest ' ). inside(' -v $HOME:/tmp/jenkins-home ' ) {
95
+ docker. withRegistry(p[ ' docker.registry ' ], p[ ' docker.credentials ' ] ) {
96
+ docker. image(" springci/spring-data-with-mongodb-4.4:${ p['java.lts.tag'] } " ). inside(p[ ' docker.java.inside.basic ' ] ) {
144
97
sh ' mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
145
98
sh ' mongod --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &'
146
99
sh ' sleep 10'
@@ -152,18 +105,18 @@ pipeline {
152
105
}
153
106
}
154
107
}
155
- stage(" test: spring53-next (jdk8 )" ) {
108
+ stage(" test: spring53-next (main )" ) {
156
109
agent {
157
110
label ' data'
158
111
}
159
112
options { timeout(time : 30 , unit : ' MINUTES' ) }
160
113
environment {
161
- ARTIFACTORY = credentials(' 02bd1690-b54f-4c9f-819d-a77cb7a9822c ' )
114
+ ARTIFACTORY = credentials(" ${ p['artifactory.credentials'] } " )
162
115
}
163
116
steps {
164
117
script {
165
- docker. withRegistry(' ' , ' hub. docker.com-springbuildmaster ' ) {
166
- docker. image(' springci/spring-data-rest-openjdk8- with-mongodb-4.4:latest ' ). inside(' -v $HOME:/tmp/jenkins-home ' ) {
118
+ docker. withRegistry(p[ ' docker.registry ' ], p[ ' docker.credentials ' ] ) {
119
+ docker. image(" springci/spring-data-with-mongodb-4.4:${ p['java.main.tag'] } " ). inside(p[ ' docker.java.inside.basic ' ] ) {
167
120
sh ' mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
168
121
sh ' mongod --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &'
169
122
sh ' sleep 10'
@@ -175,18 +128,18 @@ pipeline {
175
128
}
176
129
}
177
130
}
178
- stage(" test: spring53-next (JDK 17 )" ) {
131
+ stage(" test: spring53-next (LTS )" ) {
179
132
agent {
180
133
label ' data'
181
134
}
182
135
options { timeout(time : 30 , unit : ' MINUTES' ) }
183
136
environment {
184
- ARTIFACTORY = credentials(' 02bd1690-b54f-4c9f-819d-a77cb7a9822c ' )
137
+ ARTIFACTORY = credentials(" ${ p['artifactory.credentials'] } " )
185
138
}
186
139
steps {
187
140
script {
188
- docker. withRegistry(' ' , ' hub. docker.com-springbuildmaster ' ) {
189
- docker. image(' springci/spring-data-rest-openjdk17- with-mongodb-4.4:latest ' ). inside(' -v $HOME:/tmp/jenkins-home ' ) {
141
+ docker. withRegistry(p[ ' docker.registry ' ], p[ ' docker.credentials ' ] ) {
142
+ docker. image(" springci/spring-data-with-mongodb-4.4:${ p['java.lts.tag'] } " ). inside(p[ ' docker.java.inside.basic ' ] ) {
190
143
sh ' mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
191
144
sh ' mongod --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &'
192
145
sh ' sleep 10'
@@ -215,13 +168,13 @@ pipeline {
215
168
options { timeout(time : 20 , unit : ' MINUTES' ) }
216
169
217
170
environment {
218
- ARTIFACTORY = credentials(' 02bd1690-b54f-4c9f-819d-a77cb7a9822c ' )
171
+ ARTIFACTORY = credentials(" ${ p['artifactory.credentials'] } " )
219
172
}
220
173
221
174
steps {
222
175
script {
223
- docker. withRegistry(' ' , ' hub. docker.com-springbuildmaster ' ) {
224
- docker. image(' adoptopenjdk/openjdk8:latest ' ). inside(' -v $HOME:/tmp/jenkins-home ' ) {
176
+ docker. withRegistry(p[ ' docker.registry ' ], p[ ' docker.credentials ' ] ) {
177
+ docker. image(p[ ' docker.java.main.image ' ] ). inside(p[ ' docker.java.inside.basic ' ] ) {
225
178
sh ' MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,artifactory ' +
226
179
' -Dartifactory.server=https://repo.spring.io ' +
227
180
" -Dartifactory.username=${ ARTIFACTORY_USR} " +
0 commit comments