@@ -27,9 +27,7 @@ pipeline {
2727 script {
2828 docker. withRegistry(' ' , " ${ p['dockerhub.credentials']} " ) {
2929 def image = docker. build(" ${ p['docker.java.build.image']} " , " ci/" )
30- docker. withRegistry(' ' , " ${ p['dockerhub.credentials']} " ) {
31- image. push()
32- }
30+ image. push()
3331 }
3432 }
3533 }
@@ -44,9 +42,11 @@ pipeline {
4442 }
4543 steps {
4644 script {
47- docker. image(p[' docker.java.main.image' ]). inside(p[' docker.java.inside.basic' ]) {
48- sh " PROFILE=jakarta-ee-10,distribute,convergence ci/test.sh"
49- }
45+ docker. withRegistry(' ' , " ${ p['dockerhub.credentials']} " ) {
46+ docker. image(p[' docker.java.main.image' ]). inside(p[' docker.java.inside.basic' ]) {
47+ sh " PROFILE=jakarta-ee-10,distribute,convergence ci/test.sh"
48+ }
49+ }
5050 }
5151 }
5252 }
@@ -68,9 +68,11 @@ pipeline {
6868 }
6969 steps {
7070 script {
71- docker. image(p[' docker.java.main.image' ]). inside(p[' docker.java.inside.basic' ]) {
72- sh " PROFILE=jakarta-ee-10,spring-buildsnapshot,convergence ci/test.sh"
73- }
71+ docker. withRegistry(' ' , " ${ p['dockerhub.credentials']} " ) {
72+ docker. image(p[' docker.java.main.image' ]). inside(p[' docker.java.inside.basic' ]) {
73+ sh " PROFILE=jakarta-ee-10,spring-buildsnapshot,convergence ci/test.sh"
74+ }
75+ }
7476 }
7577 }
7678 }
@@ -85,9 +87,11 @@ pipeline {
8587 }
8688 steps {
8789 script {
88- docker. image(p[' docker.java.main.image' ]). inside(p[' docker.java.inside.basic' ]) {
89- sh " PROFILE=jakarta-ee-10,wss4j-next,convergence ci/test.sh"
90- }
90+ docker. withRegistry(' ' , " ${ p['dockerhub.credentials']} " ) {
91+ docker. image(p[' docker.java.main.image' ]). inside(p[' docker.java.inside.basic' ]) {
92+ sh " PROFILE=jakarta-ee-10,wss4j-next,convergence ci/test.sh"
93+ }
94+ }
9195 }
9296 }
9397 }
@@ -102,9 +106,11 @@ pipeline {
102106 }
103107 steps {
104108 script {
105- docker. image(p[' docker.java.main.image' ]). inside(p[' docker.java.inside.basic' ]) {
106- sh " PROFILE=jakarta-ee-10,spring-next-gen,convergence ci/test.sh"
107- }
109+ docker. withRegistry(' ' , " ${ p['dockerhub.credentials']} " ) {
110+ docker. image(p[' docker.java.main.image' ]). inside(p[' docker.java.inside.basic' ]) {
111+ sh " PROFILE=jakarta-ee-10,spring-next-gen,convergence ci/test.sh"
112+ }
113+ }
108114 }
109115 }
110116 }
@@ -161,57 +167,59 @@ pipeline {
161167
162168 steps {
163169 script {
164- docker. image(" ${ p['docker.java.build.image-proxy']} " ). inside(p[' docker.java.inside.basic' ]) {
165- PROJECT_VERSION = sh(
166- script : " ci/version.sh" ,
167- returnStdout : true
168- ). trim()
169-
170- echo " Releasing Spring WS ${ PROJECT_VERSION} ..."
171-
172- if (PROJECT_VERSION . matches(/ .*-RC[0-9]+$/ ) || PROJECT_VERSION . matches(/ .*-M[0-9]+$/ )) {
173- RELEASE_TYPE = " milestone"
174- } else if (PROJECT_VERSION . endsWith(' SNAPSHOT' )) {
175- RELEASE_TYPE = ' snapshot'
176- } else if (PROJECT_VERSION . matches(/ .*\. [0-9]+$/ )) {
177- RELEASE_TYPE = ' release'
178- } else {
179- RELEASE_TYPE = ' snapshot'
180- }
181-
182- echo " Release type: ${ RELEASE_TYPE} "
183-
184- if (RELEASE_TYPE == ' release' ) {
185-
186- STAGING_REPOSITORY_ID = sh(
187- script : " ci/rc-open.sh" ,
188- returnStdout : true
189- ). readLines()
190- .findAll{ line -> line. contains(" <repository>" ) && ! line. contains(" %s" ) }
191- .collect{ s -> s. substring(s. indexOf(" <repository>" ) + " <repository>" . length(), s. indexOf(" </repository>" )) }
192- .inject(0 ){ first , second -> second } // find the last entry, a.k.a. the most recent staging repository id
193-
194- sh " ci/build-and-deploy-to-maven-central.sh ${ PROJECT_VERSION} ${ STAGING_REPOSITORY_ID} "
195- sh " ci/rc-close.sh ${ STAGING_REPOSITORY_ID} "
196- // sh "ci/smoke-test-against-maven-central.sh ${PROJECT_VERSION} ${STAGING_REPOSITORY_ID}"
197-
198- writeFile(file : ' staging_repository_id.txt' , text : " ${ STAGING_REPOSITORY_ID} " )
199- stash ' staging_repository_id.txt'
200-
201- } else {
202-
203- sh " ci/build-and-deploy-to-artifactory.sh ${ RELEASE_TYPE} "
204-
205- // TODO: Resolve smoke testing against Artifactory
206- // sh "ci/smoke-test-against-artifactory.sh ${PROJECT_VERSION}"
207-
208- if (RELEASE_TYPE == ' milestone' ) {
209- slackSend(
210- color : (currentBuild. currentResult == ' SUCCESS' ) ? ' good' : ' danger' ,
211- channel : ' #spring-ws' ,
212- message : " Spring WS ${ PROJECT_VERSION} is released to Artifactory!" )
213- }
214- }
170+ docker. withRegistry(' ' , " ${ p['dockerhub.credentials']} " ) {
171+ docker. image(" ${ p['docker.java.build.image-proxy']} " ). inside(p[' docker.java.inside.basic' ]) {
172+ PROJECT_VERSION = sh(
173+ script : " ci/version.sh" ,
174+ returnStdout : true
175+ ). trim()
176+
177+ echo " Releasing Spring WS ${ PROJECT_VERSION} ..."
178+
179+ if (PROJECT_VERSION . matches(/ .*-RC[0-9]+$/ ) || PROJECT_VERSION . matches(/ .*-M[0-9]+$/ )) {
180+ RELEASE_TYPE = " milestone"
181+ } else if (PROJECT_VERSION . endsWith(' SNAPSHOT' )) {
182+ RELEASE_TYPE = ' snapshot'
183+ } else if (PROJECT_VERSION . matches(/ .*\. [0-9]+$/ )) {
184+ RELEASE_TYPE = ' release'
185+ } else {
186+ RELEASE_TYPE = ' snapshot'
187+ }
188+
189+ echo " Release type: ${ RELEASE_TYPE} "
190+
191+ if (RELEASE_TYPE == ' release' ) {
192+
193+ STAGING_REPOSITORY_ID = sh(
194+ script : " ci/rc-open.sh" ,
195+ returnStdout : true
196+ ). readLines()
197+ .findAll{ line -> line. contains(" <repository>" ) && ! line. contains(" %s" ) }
198+ .collect{ s -> s. substring(s. indexOf(" <repository>" ) + " <repository>" . length(), s. indexOf(" </repository>" )) }
199+ .inject(0 ){ first , second -> second } // find the last entry, a.k.a. the most recent staging repository id
200+
201+ sh " ci/build-and-deploy-to-maven-central.sh ${ PROJECT_VERSION} ${ STAGING_REPOSITORY_ID} "
202+ sh " ci/rc-close.sh ${ STAGING_REPOSITORY_ID} "
203+ // sh "ci/smoke-test-against-maven-central.sh ${PROJECT_VERSION} ${STAGING_REPOSITORY_ID}"
204+
205+ writeFile(file : ' staging_repository_id.txt' , text : " ${ STAGING_REPOSITORY_ID} " )
206+ stash ' staging_repository_id.txt'
207+
208+ } else {
209+
210+ sh " ci/build-and-deploy-to-artifactory.sh ${ RELEASE_TYPE} "
211+
212+ // TODO: Resolve smoke testing against Artifactory
213+ // sh "ci/smoke-test-against-artifactory.sh ${PROJECT_VERSION}"
214+
215+ if (RELEASE_TYPE == ' milestone' ) {
216+ slackSend(
217+ color : (currentBuild. currentResult == ' SUCCESS' ) ? ' good' : ' danger' ,
218+ channel : ' #spring-ws' ,
219+ message : " Spring WS ${ PROJECT_VERSION} is released to Artifactory!" )
220+ }
221+ }
222+ }
215223 }
216224 }
217225 }
@@ -232,45 +240,46 @@ pipeline {
232240
233241 steps {
234242 script {
243+ docker. withRegistry(' ' , " ${ p['dockerhub.credentials']} " ) {
244+ docker. image(" ${ p['docker.java.legacy.image']} " ). inside(p[' docker.java.inside.basic' ]) {
245+ PROJECT_VERSION = sh(
246+ script : " ci/version.sh" ,
247+ returnStdout : true
248+ ). trim()
235249
236- docker. image(" ${ p['docker.java.legacy.image']} " ). inside(p[' docker.java.inside.basic' ]) {
237- PROJECT_VERSION = sh(
238- script : " ci/version.sh" ,
239- returnStdout : true
240- ). trim()
241-
242- echo " Releasing Spring WS ${ PROJECT_VERSION} ..."
243-
244- if (PROJECT_VERSION . matches(/ .*-RC[0-9]+$/ ) || PROJECT_VERSION . matches(/ .*-M[0-9]+$/ )) {
245- RELEASE_TYPE = " milestone"
246- } else if (PROJECT_VERSION . endsWith(' SNAPSHOT' )) {
247- RELEASE_TYPE = ' snapshot'
248- } else if (PROJECT_VERSION . matches(/ .*\. [0-9]+$/ )) {
249- RELEASE_TYPE = ' release'
250- } else {
251- RELEASE_TYPE = ' snapshot'
252- }
250+ echo " Releasing Spring WS ${ PROJECT_VERSION} ..."
253251
254- echo " Release type: ${ RELEASE_TYPE} "
252+ if (PROJECT_VERSION . matches(/ .*-RC[0-9]+$/ ) || PROJECT_VERSION . matches(/ .*-M[0-9]+$/ )) {
253+ RELEASE_TYPE = " milestone"
254+ } else if (PROJECT_VERSION . endsWith(' SNAPSHOT' )) {
255+ RELEASE_TYPE = ' snapshot'
256+ } else if (PROJECT_VERSION . matches(/ .*\. [0-9]+$/ )) {
257+ RELEASE_TYPE = ' release'
258+ } else {
259+ RELEASE_TYPE = ' snapshot'
260+ }
255261
256- if ( RELEASE_TYPE == ' release ' ) {
262+ echo " Release type: ${ RELEASE_TYPE } "
257263
258- unstash ' staging_repository_id.txt '
264+ if ( RELEASE_TYPE == ' release ' ) {
259265
260- def STAGING_REPOSITORY_ID = readFile( file : ' staging_repository_id.txt' )
266+ unstash ' staging_repository_id.txt'
261267
262- sh " ci/rc-release.sh ${ STAGING_REPOSITORY_ID} "
268+ def STAGING_REPOSITORY_ID = readFile( file : ' staging_repository_id.txt ' )
263269
264- slackSend(
265- color : (currentBuild. currentResult == ' SUCCESS' ) ? ' good' : ' danger' ,
266- channel : ' #spring-ws' ,
267- message : " Spring WS ${ PROJECT_VERSION} is released to Maven Central!" )
268- } else {
270+ sh " ci/rc-release.sh ${ STAGING_REPOSITORY_ID} "
269271
270- echo " Since this is an Artifactory release, there is no 'part 2'."
272+ slackSend(
273+ color : (currentBuild. currentResult == ' SUCCESS' ) ? ' good' : ' danger' ,
274+ channel : ' #spring-ws' ,
275+ message : " Spring WS ${ PROJECT_VERSION} is released to Maven Central!" )
276+ } else {
271277
272- }
273- }
278+ echo " Since this is an Artifactory release, there is no 'part 2'."
279+
280+ }
281+ }
282+ }
274283 }
275284 }
276285 }
@@ -291,17 +300,19 @@ pipeline {
291300
292301 steps {
293302 script {
294- docker. image(p[' docker.java.main.image' ]). inside(p[' docker.java.inside.basic' ]) {
295- sh ' MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ' +
296- ' GRADLE_ENTERPRISE_CACHE_USERNAME=${GRADLE_ENTERPRISE_CACHE_USR} ' +
297- ' GRADLE_ENTERPRISE_CACHE_PASSWORD=${GRADLE_ENTERPRISE_CACHE_PSW} ' +
298- ' ./mvnw -s settings.xml -Pjakarta-ee-10,distribute,docs ' +
299- ' -Dartifactory.server=https://repo.spring.io ' +
300- " -Dartifactory.username=${ ARTIFACTORY_USR} " +
301- " -Dartifactory.password=${ ARTIFACTORY_PSW} " +
302- " -Dartifactory.distribution-repository=temp-private-local " +
303- ' -Duser.name=spring-builds+jenkins -Dmaven.test.skip=true -Dmaven.deploy.skip=true deploy -B'
304- }
303+ docker. withRegistry(' ' , " ${ p['dockerhub.credentials']} " ) {
304+ docker. image(p[' docker.java.main.image' ]). inside(p[' docker.java.inside.basic' ]) {
305+ sh ' MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ' +
306+ ' GRADLE_ENTERPRISE_CACHE_USERNAME=${GRADLE_ENTERPRISE_CACHE_USR} ' +
307+ ' GRADLE_ENTERPRISE_CACHE_PASSWORD=${GRADLE_ENTERPRISE_CACHE_PSW} ' +
308+ ' ./mvnw -s settings.xml -Pjakarta-ee-10,distribute,docs ' +
309+ ' -Dartifactory.server=https://repo.spring.io ' +
310+ " -Dartifactory.username=${ ARTIFACTORY_USR} " +
311+ " -Dartifactory.password=${ ARTIFACTORY_PSW} " +
312+ " -Dartifactory.distribution-repository=temp-private-local " +
313+ ' -Duser.name=spring-builds+jenkins -Dmaven.test.skip=true -Dmaven.deploy.skip=true deploy -B'
314+ }
315+ }
305316 }
306317 }
307318 }
0 commit comments