@@ -26,6 +26,7 @@ pipeline {
26
26
}
27
27
}
28
28
}
29
+
29
30
stage(" Test: baseline (jdk8)" ) {
30
31
agent {
31
32
docker {
@@ -37,6 +38,7 @@ pipeline {
37
38
sh " PROFILE=distribute,convergence ci/test.sh"
38
39
}
39
40
}
41
+
40
42
stage(" Test other configurations" ) {
41
43
parallel {
42
44
stage(" Test: spring-buildsnapshot (jdk8)" ) {
@@ -96,16 +98,21 @@ pipeline {
96
98
}
97
99
}
98
100
}
99
- stage(' Deploy to Artifactory' ) {
101
+
102
+ stage(' Deploy' ) {
100
103
agent {
101
104
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'
104
107
}
105
108
}
109
+ options { timeout(time : 20 , unit : ' MINUTES' ) }
106
110
107
111
environment {
108
112
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' )
109
116
}
110
117
111
118
steps {
@@ -115,94 +122,53 @@ pipeline {
115
122
returnStdout : true
116
123
). trim()
117
124
118
- RELEASE_TYPE = ' snapshot'
119
-
120
125
if (PROJECT_VERSION . matches(/ .*-RC[0-9]+$/ ) || PROJECT_VERSION . matches(/ .*-M[0-9]+$/ )) {
121
126
RELEASE_TYPE = " milestone"
122
127
} else if (PROJECT_VERSION . endsWith(' SNAPSHOT' )) {
123
128
RELEASE_TYPE = ' snapshot'
124
129
} else if (PROJECT_VERSION . matches(/ .*\. [0-9]+$/ )) {
125
130
RELEASE_TYPE = ' release'
131
+ } else {
132
+ RELEASE_TYPE = ' snapshot'
126
133
}
127
134
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} "
171
137
} 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 "
173
139
}
174
140
}
175
141
}
176
142
}
177
- stage(' Sync to Maven Central' ) {
143
+
144
+ stage(' Release documentation' ) {
178
145
when {
179
- branch ' release'
146
+ anyOf {
147
+ branch ' master'
148
+ branch ' release'
149
+ branch ' issue/test-release'
150
+ }
180
151
}
181
152
agent {
182
153
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'
185
156
}
186
157
}
158
+ options { timeout(time : 20 , unit : ' MINUTES' ) }
187
159
188
160
environment {
189
- BINTRAY = credentials(' Bintray-spring-operator' )
190
- SONATYPE = credentials(' oss-token' )
161
+ ARTIFACTORY = credentials(' 02bd1690-b54f-4c9f-819d-a77cb7a9822c' )
191
162
}
192
163
193
164
steps {
194
165
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'
206
172
}
207
173
}
208
174
}
0 commit comments