Skip to content

Commit

Permalink
Move rc-release to legacy Docker container.
Browse files Browse the repository at this point in the history
To avoid issues with higher versions of Java and the nexus-maven-staging-plugin, move the final command to a legacy Docker container.
  • Loading branch information
gregturn committed Oct 23, 2023
1 parent ce8eaf5 commit a306e9b
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 6 deletions.
68 changes: 62 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,12 @@ pipeline {
.inject(0){ first, second -> second } // find the last entry, a.k.a. the most recent staging repository id

sh "ci/build-and-deploy-to-maven-central.sh ${PROJECT_VERSION} ${STAGING_REPOSITORY_ID}"
// sh "ci/rc-close.sh ${STAGING_REPOSITORY_ID}"
sh "ci/rc-close.sh ${STAGING_REPOSITORY_ID}"
// sh "ci/smoke-test-against-maven-central.sh ${PROJECT_VERSION} ${STAGING_REPOSITORY_ID}"
// sh "ci/rc-release.sh ${STAGING_REPOSITORY_ID}"

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

} else {

sh "ci/build-and-deploy-to-artifactory.sh ${RELEASE_TYPE}"
Expand All @@ -218,6 +216,64 @@ pipeline {
}
}

stage('Deploy (part 2)') {
agent any
options { timeout(time: 20, unit: 'MINUTES') }
environment {
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
SONATYPE = credentials('oss-login')
KEYRING = credentials('spring-signing-secring.gpg')
PASSPHRASE = credentials('spring-gpg-passphrase')
STAGING_PROFILE_ID = credentials('spring-data-release-deployment-maven-central-staging-profile-id')
GRADLE_ENTERPRISE_CACHE = credentials("${p['gradle-enterprise-cache.credentials']}")
GRADLE_ENTERPRISE_ACCESS_KEY = credentials("${p['gradle-enterprise.access-key']}")
}

steps {
script {

docker.image("${p['docker.java.legacy.image']}").inside(p['docker.java.inside.basic']) {
PROJECT_VERSION = sh(
script: "ci/version.sh",
returnStdout: true
).trim()

echo "Releasing Spring WS ${PROJECT_VERSION}..."

if (PROJECT_VERSION.matches(/.*-RC[0-9]+$/) || PROJECT_VERSION.matches(/.*-M[0-9]+$/)) {
RELEASE_TYPE = "milestone"
} else if (PROJECT_VERSION.endsWith('SNAPSHOT')) {
RELEASE_TYPE = 'snapshot'
} else if (PROJECT_VERSION.matches(/.*\.[0-9]+$/)) {
RELEASE_TYPE = 'release'
} else {
RELEASE_TYPE = 'snapshot'
}

echo "Release type: ${RELEASE_TYPE}"

if (RELEASE_TYPE == 'release') {

unstash 'staging_repository_id.txt'

def STAGING_REPOSITORY_ID = readFile(file: 'staging_repository_id.txt')

sh "ci/rc-release.sh ${STAGING_REPOSITORY_ID}"

slackSend(
color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger',
channel: '#spring-ws',
message: "Spring WS ${PROJECT_VERSION} is released to Maven Central!")
} else {

echo "Since this is an Artifactory release, there is no 'part 2'."

}
}
}
}
}

stage('Release documentation') {
when {
beforeAgent(true)
Expand Down
2 changes: 2 additions & 0 deletions ci/pipeline.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Java versions
java.legacy.tag=8u362-b09-jdk-focal
java.main.tag=17.0.6_10-jdk-focal
java.next.tag=20-jdk-jammy

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

Expand Down

0 comments on commit a306e9b

Please sign in to comment.