Skip to content

Commit a306e9b

Browse files
committed
Move rc-release to legacy Docker container.
To avoid issues with higher versions of Java and the nexus-maven-staging-plugin, move the final command to a legacy Docker container.
1 parent ce8eaf5 commit a306e9b

File tree

2 files changed

+64
-6
lines changed

2 files changed

+64
-6
lines changed

Jenkinsfile

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,12 @@ pipeline {
191191
.inject(0){ first, second -> second } // find the last entry, a.k.a. the most recent staging repository id
192192

193193
sh "ci/build-and-deploy-to-maven-central.sh ${PROJECT_VERSION} ${STAGING_REPOSITORY_ID}"
194-
// sh "ci/rc-close.sh ${STAGING_REPOSITORY_ID}"
194+
sh "ci/rc-close.sh ${STAGING_REPOSITORY_ID}"
195195
// sh "ci/smoke-test-against-maven-central.sh ${PROJECT_VERSION} ${STAGING_REPOSITORY_ID}"
196-
// sh "ci/rc-release.sh ${STAGING_REPOSITORY_ID}"
197196

198-
slackSend(
199-
color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger',
200-
channel: '#spring-ws',
201-
message: "Spring WS ${PROJECT_VERSION} is released to Maven Central!")
197+
writeFile(file: 'staging_repository_id.txt', text: "${STAGING_REPOSITORY_ID}")
198+
stash 'staging_repository_id.txt'
199+
202200
} else {
203201

204202
sh "ci/build-and-deploy-to-artifactory.sh ${RELEASE_TYPE}"
@@ -218,6 +216,64 @@ pipeline {
218216
}
219217
}
220218

219+
stage('Deploy (part 2)') {
220+
agent any
221+
options { timeout(time: 20, unit: 'MINUTES') }
222+
environment {
223+
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
224+
SONATYPE = credentials('oss-login')
225+
KEYRING = credentials('spring-signing-secring.gpg')
226+
PASSPHRASE = credentials('spring-gpg-passphrase')
227+
STAGING_PROFILE_ID = credentials('spring-data-release-deployment-maven-central-staging-profile-id')
228+
GRADLE_ENTERPRISE_CACHE = credentials("${p['gradle-enterprise-cache.credentials']}")
229+
GRADLE_ENTERPRISE_ACCESS_KEY = credentials("${p['gradle-enterprise.access-key']}")
230+
}
231+
232+
steps {
233+
script {
234+
235+
docker.image("${p['docker.java.legacy.image']}").inside(p['docker.java.inside.basic']) {
236+
PROJECT_VERSION = sh(
237+
script: "ci/version.sh",
238+
returnStdout: true
239+
).trim()
240+
241+
echo "Releasing Spring WS ${PROJECT_VERSION}..."
242+
243+
if (PROJECT_VERSION.matches(/.*-RC[0-9]+$/) || PROJECT_VERSION.matches(/.*-M[0-9]+$/)) {
244+
RELEASE_TYPE = "milestone"
245+
} else if (PROJECT_VERSION.endsWith('SNAPSHOT')) {
246+
RELEASE_TYPE = 'snapshot'
247+
} else if (PROJECT_VERSION.matches(/.*\.[0-9]+$/)) {
248+
RELEASE_TYPE = 'release'
249+
} else {
250+
RELEASE_TYPE = 'snapshot'
251+
}
252+
253+
echo "Release type: ${RELEASE_TYPE}"
254+
255+
if (RELEASE_TYPE == 'release') {
256+
257+
unstash 'staging_repository_id.txt'
258+
259+
def STAGING_REPOSITORY_ID = readFile(file: 'staging_repository_id.txt')
260+
261+
sh "ci/rc-release.sh ${STAGING_REPOSITORY_ID}"
262+
263+
slackSend(
264+
color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger',
265+
channel: '#spring-ws',
266+
message: "Spring WS ${PROJECT_VERSION} is released to Maven Central!")
267+
} else {
268+
269+
echo "Since this is an Artifactory release, there is no 'part 2'."
270+
271+
}
272+
}
273+
}
274+
}
275+
}
276+
221277
stage('Release documentation') {
222278
when {
223279
beforeAgent(true)

ci/pipeline.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Java versions
2+
java.legacy.tag=8u362-b09-jdk-focal
23
java.main.tag=17.0.6_10-jdk-focal
34
java.next.tag=20-jdk-jammy
45

56
# Docker container images - standard
7+
docker.java.legacy.image=harbor-repo.vmware.com/dockerhub-proxy-cache/library/eclipse-temurin:${java.legacy.tag}
68
docker.java.main.image=harbor-repo.vmware.com/dockerhub-proxy-cache/library/eclipse-temurin:${java.main.tag}
79
docker.java.next.image=harbor-repo.vmware.com/dockerhub-proxy-cache/library/eclipse-temurin:${java.next.tag}
810

0 commit comments

Comments
 (0)