@@ -77,10 +77,67 @@ pipeline {
77
77
}
78
78
}
79
79
}
80
+ stage(' Publish JDK (Java 20) + MongoDB 4.4' ) {
81
+ when {
82
+ anyOf {
83
+ changeset " ci/openjdk20-mongodb-4.4/**"
84
+ changeset " ci/pipeline.properties"
85
+ }
86
+ }
87
+ agent { label ' data' }
88
+ options { timeout(time : 30 , unit : ' MINUTES' ) }
89
+
90
+ steps {
91
+ script {
92
+ def image = docker. build(" springci/spring-data-with-mongodb-4.4:${ p['java.next.tag']} " , " --build-arg BASE=${ p['docker.java.next.image']} --build-arg MONGODB=${ p['docker.mongodb.4.4.version']} ci/openjdk20-mongodb-4.4/" )
93
+ docker. withRegistry(p[' docker.registry' ], p[' docker.credentials' ]) {
94
+ image. push()
95
+ }
96
+ }
97
+ }
98
+ }
99
+ stage(' Publish JDK (Java 20) + MongoDB 5.0' ) {
100
+ when {
101
+ anyOf {
102
+ changeset " ci/openjdk20-mongodb-5.0/**"
103
+ changeset " ci/pipeline.properties"
104
+ }
105
+ }
106
+ agent { label ' data' }
107
+ options { timeout(time : 30 , unit : ' MINUTES' ) }
108
+
109
+ steps {
110
+ script {
111
+ def image = docker. build(" springci/spring-data-with-mongodb-5.0:${ p['java.next.tag']} " , " --build-arg BASE=${ p['docker.java.next.image']} --build-arg MONGODB=${ p['docker.mongodb.5.0.version']} ci/openjdk20-mongodb-5.0/" )
112
+ docker. withRegistry(p[' docker.registry' ], p[' docker.credentials' ]) {
113
+ image. push()
114
+ }
115
+ }
116
+ }
117
+ }
118
+ stage(' Publish JDK (Java 20) + MongoDB 6.0' ) {
119
+ when {
120
+ anyOf {
121
+ changeset " ci/openjdk20-mongodb-6.0/**"
122
+ changeset " ci/pipeline.properties"
123
+ }
124
+ }
125
+ agent { label ' data' }
126
+ options { timeout(time : 30 , unit : ' MINUTES' ) }
127
+
128
+ steps {
129
+ script {
130
+ def image = docker. build(" springci/spring-data-with-mongodb-6.0:${ p['java.next.tag']} " , " --build-arg BASE=${ p['docker.java.next.image']} --build-arg MONGODB=${ p['docker.mongodb.6.0.version']} ci/openjdk20-mongodb-6.0/" )
131
+ docker. withRegistry(p[' docker.registry' ], p[' docker.credentials' ]) {
132
+ image. push()
133
+ }
134
+ }
135
+ }
136
+ }
80
137
}
81
138
}
82
139
83
- stage(" test: baseline (Java 17 )" ) {
140
+ stage(" test: baseline (main )" ) {
84
141
when {
85
142
beforeAgent(true )
86
143
anyOf {
@@ -119,7 +176,73 @@ pipeline {
119
176
}
120
177
parallel {
121
178
122
- stage(" test: MongoDB 5.0 (Java 17)" ) {
179
+ stage(" test: MongoDB 5.0 (main)" ) {
180
+ agent {
181
+ label ' data'
182
+ }
183
+ options { timeout(time : 30 , unit : ' MINUTES' ) }
184
+ environment {
185
+ ARTIFACTORY = credentials(" ${ p['artifactory.credentials']} " )
186
+ }
187
+ steps {
188
+ script {
189
+ docker. image(" harbor-repo.vmware.com/dockerhub-proxy-cache/springci/spring-data-with-mongodb-5.0:${ p['java.main.tag']} " ). inside(p[' docker.java.inside.basic' ]) {
190
+ sh ' mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
191
+ sh ' mongod --setParameter transactionLifetimeLimitSeconds=90 --setParameter maxTransactionLockRequestTimeoutMillis=10000 --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &'
192
+ sh ' sleep 10'
193
+ sh ' mongo --eval "rs.initiate({_id: \' rs0\' , members:[{_id: 0, host: \' 127.0.0.1:27017\' }]});"'
194
+ sh ' sleep 15'
195
+ sh ' MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean dependency:list test -Duser.name=jenkins -Dsort -U -B'
196
+ }
197
+ }
198
+ }
199
+ }
200
+
201
+ stage(" test: MongoDB 6.0 (main)" ) {
202
+ agent {
203
+ label ' data'
204
+ }
205
+ options { timeout(time : 30 , unit : ' MINUTES' ) }
206
+ environment {
207
+ ARTIFACTORY = credentials(" ${ p['artifactory.credentials']} " )
208
+ }
209
+ steps {
210
+ script {
211
+ docker. image(" harbor-repo.vmware.com/dockerhub-proxy-cache/springci/spring-data-with-mongodb-6.0:${ p['java.main.tag']} " ). inside(p[' docker.java.inside.basic' ]) {
212
+ sh ' mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
213
+ sh ' mongod --setParameter transactionLifetimeLimitSeconds=90 --setParameter maxTransactionLockRequestTimeoutMillis=10000 --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &'
214
+ sh ' sleep 10'
215
+ sh ' mongosh --eval "rs.initiate({_id: \' rs0\' , members:[{_id: 0, host: \' 127.0.0.1:27017\' }]});"'
216
+ sh ' sleep 15'
217
+ sh ' MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean dependency:list test -Duser.name=jenkins -Dsort -U -B'
218
+ }
219
+ }
220
+ }
221
+ }
222
+
223
+ stage(" test: MongoDB 4.4 (next)" ) {
224
+ agent {
225
+ label ' data'
226
+ }
227
+ options { timeout(time : 30 , unit : ' MINUTES' ) }
228
+ environment {
229
+ ARTIFACTORY = credentials(" ${ p['artifactory.credentials']} " )
230
+ }
231
+ steps {
232
+ script {
233
+ docker. image(" harbor-repo.vmware.com/dockerhub-proxy-cache/springci/spring-data-with-mongodb-5.0:${ p['java.main.tag']} " ). inside(p[' docker.java.inside.basic' ]) {
234
+ sh ' mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
235
+ sh ' mongod --setParameter transactionLifetimeLimitSeconds=90 --setParameter maxTransactionLockRequestTimeoutMillis=10000 --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &'
236
+ sh ' sleep 10'
237
+ sh ' mongo --eval "rs.initiate({_id: \' rs0\' , members:[{_id: 0, host: \' 127.0.0.1:27017\' }]});"'
238
+ sh ' sleep 15'
239
+ sh ' MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean dependency:list test -Duser.name=jenkins -Dsort -U -B'
240
+ }
241
+ }
242
+ }
243
+ }
244
+
245
+ stage(" test: MongoDB 5.0 (next)" ) {
123
246
agent {
124
247
label ' data'
125
248
}
@@ -141,7 +264,7 @@ pipeline {
141
264
}
142
265
}
143
266
144
- stage(" test: MongoDB 6.0 (Java 17 )" ) {
267
+ stage(" test: MongoDB 6.0 (next )" ) {
145
268
agent {
146
269
label ' data'
147
270
}
0 commit comments