@@ -26,6 +26,7 @@ pipeline {
2626 }
2727 }
2828 }
29+
2930 stage(" Test: baseline (jdk8)" ) {
3031 agent {
3132 docker {
@@ -37,6 +38,7 @@ pipeline {
3738 sh " PROFILE=distribute,convergence ci/test.sh"
3839 }
3940 }
41+
4042 stage(" Test other configurations" ) {
4143 parallel {
4244 stage(" Test: spring-buildsnapshot (jdk8)" ) {
@@ -96,16 +98,21 @@ pipeline {
9698 }
9799 }
98100 }
99- stage(' Deploy to Artifactory' ) {
101+
102+ stage(' Deploy' ) {
100103 agent {
101104 docker {
102- image ' adoptopenjdk/ openjdk8:latest'
103- args ' -v $HOME/.m2:/root /.m2'
105+ image ' springci/spring-ws- openjdk8-with-jq :latest'
106+ args ' -v $HOME/.m2:/tmp/jenkins-home /.m2'
104107 }
105108 }
109+ options { timeout(time : 20 , unit : ' MINUTES' ) }
106110
107111 environment {
108112 ARTIFACTORY = credentials(' 02bd1690-b54f-4c9f-819d-a77cb7a9822c' )
113+ SONATYPE = credentials(' oss-token' )
114+ KEYRING = credentials(' spring-signing-secring.gpg' )
115+ PASSPHRASE = credentials(' spring-gpg-passphrase' )
109116 }
110117
111118 steps {
@@ -115,94 +122,53 @@ pipeline {
115122 returnStdout : true
116123 ). trim()
117124
118- RELEASE_TYPE = ' snapshot'
119-
120125 if (PROJECT_VERSION . matches(/ .*-RC[0-9]+$/ ) || PROJECT_VERSION . matches(/ .*-M[0-9]+$/ )) {
121126 RELEASE_TYPE = " milestone"
122127 } else if (PROJECT_VERSION . endsWith(' SNAPSHOT' )) {
123128 RELEASE_TYPE = ' snapshot'
124129 } else if (PROJECT_VERSION . matches(/ .*\. [0-9]+$/ )) {
125130 RELEASE_TYPE = ' release'
131+ } else {
132+ RELEASE_TYPE = ' snapshot'
126133 }
127134
128- OUTPUT = sh(
129- script : " PROFILE=distribute,docs,${ RELEASE_TYPE} ci/build.sh" ,
130- returnStdout : true
131- ). trim()
132-
133- echo " $OUTPUT "
134-
135- build_info_path = OUTPUT . split(' \n ' )
136- .find { it. contains(' Artifactory Build Info Recorder' ) }
137- .split(' Saving Build Info to ' )[1 ]
138- .trim()[1 .. -2 ]
139-
140- dir(build_info_path + ' /..' ) {
141- stash name : ' build_info' , includes : " *.json"
142- }
143- }
144- }
145- }
146- stage(' Promote to Bintray' ) {
147- when {
148- branch ' release'
149- }
150- agent {
151- docker {
152- image ' springci/spring-ws-openjdk8-with-jq:latest'
153- args ' -v $HOME/.m2:/root/.m2'
154- }
155- }
156-
157- environment {
158- ARTIFACTORY = credentials(' 02bd1690-b54f-4c9f-819d-a77cb7a9822c' )
159- }
160-
161- steps {
162- script {
163- PROJECT_VERSION = sh(
164- script : " ci/version.sh" ,
165- returnStdout : true
166- ). trim()
167-
168- if (PROJECT_VERSION . matches(/ .*\. [0-9]+$/ )) {
169- unstash name : ' build_info'
170- sh " ci/promote-to-bintray.sh"
135+ if (RELEASE_TYPE == ' release' ) {
136+ sh " PROFILE=distribute,central USERNAME=${ SONATYPE_USR} PASSWORD=${ SONATYPE_PSW} ci/build-and-deploy-to-maven-central.sh ${ PROJECT_VERSION} "
171137 } else {
172- echo " ${ PROJECT_VERSION } is not a candidate for promotion to Bintray. "
138+ sh " PROFILE=distribute, ${ RELEASE_TYPE } ci/build-and-deploy-to-artifactory.sh "
173139 }
174140 }
175141 }
176142 }
177- stage(' Sync to Maven Central' ) {
143+
144+ stage(' Release documentation' ) {
178145 when {
179- branch ' release'
146+ anyOf {
147+ branch ' master'
148+ branch ' release'
149+ branch ' issue/test-release'
150+ }
180151 }
181152 agent {
182153 docker {
183- image ' springci/spring-ws- openjdk8-with-jq :latest'
184- args ' -v $HOME/.m2:/root /.m2'
154+ image ' adoptopenjdk/ openjdk8:latest'
155+ args ' -v $HOME/.m2:/tmp/jenkins-home /.m2'
185156 }
186157 }
158+ options { timeout(time : 20 , unit : ' MINUTES' ) }
187159
188160 environment {
189- BINTRAY = credentials(' Bintray-spring-operator' )
190- SONATYPE = credentials(' oss-token' )
161+ ARTIFACTORY = credentials(' 02bd1690-b54f-4c9f-819d-a77cb7a9822c' )
191162 }
192163
193164 steps {
194165 script {
195- PROJECT_VERSION = sh(
196- script : " ci/version.sh" ,
197- returnStdout : true
198- ). trim()
199-
200- if (PROJECT_VERSION . matches(/ .*\. [0-9]+$/ )) {
201- unstash name : ' build_info'
202- sh " ci/sync-to-maven-central.sh"
203- } else {
204- echo " ${ PROJECT_VERSION} is not a candidate for syncing to Maven Central."
205- }
166+ sh ' MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pdistribute,docs ' +
167+ ' -Dartifactory.server=https://repo.spring.io ' +
168+ " -Dartifactory.username=${ ARTIFACTORY_USR} " +
169+ " -Dartifactory.password=${ ARTIFACTORY_PSW} " +
170+ " -Dartifactory.distribution-repository=temp-private-local " +
171+ ' -Dmaven.test.skip=true -Dmaven.deploy.skip=true deploy -B'
206172 }
207173 }
208174 }
0 commit comments