Authenticate with Artifactory to build the SBDG artifact(s) and deploy docs.

Authentication with Artifactory is necessary to resolve the io.spring.docresources:spring-doc-resources:0.2.5 artifact from repo.spring.io/release.
This commit is contained in:
John Blum
2023-06-02 11:04:21 -07:00
parent 6629bfc4e0
commit 3a6cc56cbd
3 changed files with 43 additions and 29 deletions

63
Jenkinsfile vendored
View File

@@ -21,6 +21,9 @@ pipeline {
stages {
stage('Build') {
environment {
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
}
options {
timeout(time: 15, unit: "MINUTES")
}
@@ -28,29 +31,30 @@ pipeline {
script {
docker.withRegistry(p['docker.registry'], p['docker.credentials']) {
docker.image(p['docker.container.image.java.main']).inside(p['docker.container.inside.env.full']) {
withCredentials([usernamePassword(credentialsId: p['artifactory.credentials'], usernameVariable: 'ARTIFACTORY_USERNAME', passwordVariable: 'ARTIFACTORY_PASSWORD')]) {
sh "echo 'Setup build environment...'"
sh "ci/setup.sh"
sh "echo 'Setup build environment...'"
sh "ci/setup.sh"
// Cleanup any prior build system resources
try {
sh "echo 'Clean up GemFire/Geode files & build artifacts...'"
sh "ci/cleanupArtifacts.sh"
sh "ci/cleanupGemFiles.sh"
}
catch (ignore) { }
// Cleanup any prior build system resources
try {
sh "echo 'Clean up GemFire/Geode files & build artifacts...'"
sh "ci/cleanupArtifacts.sh"
sh "ci/cleanupGemFiles.sh"
}
catch (ignore) { }
// Run the SBDG project Gradle build using JDK 8 inside Docker
try {
sh "echo 'Building SBDG...'"
sh "ci/build.sh"
}
catch (e) {
currentBuild.result = "FAILED: build"
throw e
}
finally {
junit '**/build/test-results/*/*.xml'
// Run the SBDG project Gradle build using JDK 8 inside Docker
try {
sh "echo 'Building SBDG...'"
sh "ci/build.sh"
}
catch (e) {
currentBuild.result = "FAILED: build"
throw e
}
finally {
junit '**/build/test-results/*/*.xml'
}
}
}
}
@@ -59,6 +63,9 @@ pipeline {
}
stage ('Deploy Docs') {
environment {
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
}
options {
timeout(time: 15, unit: "MINUTES")
}
@@ -66,12 +73,14 @@ pipeline {
script {
docker.image('adoptopenjdk/openjdk8:latest').inside("--name ${env.HOSTNAME}Two -u root -v /tmp:/tmp") {
withCredentials([file(credentialsId: 'docs.spring.io-jenkins_private_ssh_key', variable: 'DEPLOY_SSH_KEY')]) {
try {
sh "ci/deployDocs.sh"
}
catch (e) {
currentBuild.result = "FAILED: deploy docs"
throw e
withCredentials([usernamePassword(credentialsId: p['artifactory.credentials'], usernameVariable: 'ARTIFACTORY_USERNAME', passwordVariable: 'ARTIFACTORY_PASSWORD')]) {
try {
sh "ci/deployDocs.sh"
}
catch (e) {
currentBuild.result = "FAILED: deploy docs"
throw e
}
}
}
}

View File

@@ -3,4 +3,7 @@
set -eou pipefail
GRADLE_OPTS="-Duser.name=jenkins -Djava.io.tmpdir=/tmp -Dgradle.user.home=/tmp/geode/boot/build-gradle-cache" \
./gradlew --no-daemon --refresh-dependencies --stacktrace clean build
./gradlew --no-daemon --refresh-dependencies --stacktrace clean build \
-PartifactoryUsername=$ARTIFACTORY_USERNAME \
-PartifactoryPassword=$ARTIFACTORY_PASSWORD

View File

@@ -3,4 +3,6 @@
set -eou pipefail
GRADLE_OPTS="-Duser.name=jenkins -Djava.io.tmpdir=/tmp -Dgradle.user.home=/tmp/geode/boot/build-gradle-cache" \
./gradlew --no-daemon --refresh-dependencies --stacktrace clean check
./gradlew --no-daemon --refresh-dependencies --stacktrace clean check \
-PartifactoryUsername=$ARTIFACTORY_USERNAME \
-PartifactoryPassword=$ARTIFACTORY_PASSWORD