Skip to content

Commit d0f2ca9

Browse files
committed
Polishing.
Refine build script. See #3949
1 parent e6c8ee0 commit d0f2ca9

File tree

1 file changed

+9
-56
lines changed

1 file changed

+9
-56
lines changed

Jenkinsfile

+9-56
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ pipeline {
2020
stages {
2121
stage("Docker images") {
2222
parallel {
23-
stage('Publish JDK (main) + MongoDB 5.0') {
23+
stage('Publish JDK (Java 17) + MongoDB 4.4') {
2424
when {
2525
anyOf {
26-
changeset "ci/openjdk17-mongodb-5.0/**"
26+
changeset "ci/openjdk17-mongodb-4.4/**"
2727
changeset "ci/pipeline.properties"
2828
}
2929
}
@@ -32,17 +32,17 @@ pipeline {
3232

3333
steps {
3434
script {
35-
def image = docker.build("springci/spring-data-with-mongodb-5.0:${p['java.main.tag']}", "--build-arg BASE=${p['docker.java.main.image']} --build-arg MONGODB=${p['docker.mongodb.5.0.version']} ci/openjdk17-mongodb-5.0/")
35+
def image = docker.build("springci/spring-data-with-mongodb-4.4:${p['java.main.tag']}", "--build-arg BASE=${p['docker.java.main.image']} --build-arg MONGODB=${p['docker.mongodb.4.4.version']} ci/openjdk17-mongodb-4.4/")
3636
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
3737
image.push()
3838
}
3939
}
4040
}
4141
}
42-
stage('Publish JDK (main) + MongoDB 4.4') {
42+
stage('Publish JDK (Java 17) + MongoDB 5.0') {
4343
when {
4444
anyOf {
45-
changeset "ci/openjdk17-mongodb-4.4/**"
45+
changeset "ci/openjdk17-mongodb-5.0/**"
4646
changeset "ci/pipeline.properties"
4747
}
4848
}
@@ -51,7 +51,7 @@ pipeline {
5151

5252
steps {
5353
script {
54-
def image = docker.build("springci/spring-data-with-mongodb-4.4:${p['java.main.tag']}", "--build-arg BASE=${p['docker.java.main.image']} --build-arg MONGODB=${p['docker.mongodb.4.4.version']} ci/openjdk17-mongodb-4.4/")
54+
def image = docker.build("springci/spring-data-with-mongodb-5.0:${p['java.main.tag']}", "--build-arg BASE=${p['docker.java.main.image']} --build-arg MONGODB=${p['docker.mongodb.5.0.version']} ci/openjdk17-mongodb-5.0/")
5555
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
5656
image.push()
5757
}
@@ -61,7 +61,7 @@ pipeline {
6161
}
6262
}
6363

64-
stage("test: baseline (main)") {
64+
stage("test: baseline (Java 17)") {
6565
when {
6666
beforeAgent(true)
6767
anyOf {
@@ -79,7 +79,7 @@ pipeline {
7979
steps {
8080
script {
8181
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
82-
docker.image("springci/spring-data-with-mongodb-4.0:${p['java.main.tag']}").inside(p['docker.java.inside.basic']) {
82+
docker.image("springci/spring-data-with-mongodb-4.4:${p['java.main.tag']}").inside(p['docker.java.inside.basic']) {
8383
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
8484
sh 'mongod --setParameter transactionLifetimeLimitSeconds=90 --setParameter maxTransactionLockRequestTimeoutMillis=10000 --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &'
8585
sh 'sleep 10'
@@ -101,31 +101,8 @@ pipeline {
101101
}
102102
}
103103
parallel {
104-
stage("test: mongodb 4.4 (main)") {
105-
agent {
106-
label 'data'
107-
}
108-
options { timeout(time: 30, unit: 'MINUTES') }
109-
environment {
110-
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
111-
}
112-
steps {
113-
script {
114-
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
115-
docker.image("springci/spring-data-with-mongodb-4.4:${p['java.main.tag']}").inside(p['docker.java.inside.basic']) {
116-
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
117-
sh 'mongod --setParameter transactionLifetimeLimitSeconds=90 --setParameter maxTransactionLockRequestTimeoutMillis=10000 --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &'
118-
sh 'sleep 10'
119-
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
120-
sh 'sleep 15'
121-
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'
122-
}
123-
}
124-
}
125-
}
126-
}
127104

128-
stage("test: mongodb 5.0 (main)") {
105+
stage("test: mongodb 5.0 (Java 17)") {
129106
agent {
130107
label 'data'
131108
}
@@ -148,30 +125,6 @@ pipeline {
148125
}
149126
}
150127
}
151-
152-
stage("test: baseline (LTS)") {
153-
agent {
154-
label 'data'
155-
}
156-
options { timeout(time: 30, unit: 'MINUTES') }
157-
environment {
158-
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
159-
}
160-
steps {
161-
script {
162-
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
163-
docker.image("springci/spring-data-with-mongodb-4.4:${p['java.lts.tag']}").inside(p['docker.java.inside.basic']) {
164-
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
165-
sh 'mongod --setParameter transactionLifetimeLimitSeconds=90 --setParameter maxTransactionLockRequestTimeoutMillis=10000 --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &'
166-
sh 'sleep 10'
167-
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
168-
sh 'sleep 15'
169-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pjava11 clean dependency:list test -Duser.name=jenkins -Dsort -U -B'
170-
}
171-
}
172-
}
173-
}
174-
}
175128
}
176129
}
177130

0 commit comments

Comments
 (0)