Wrap all shell calls in base_dir in Jenkins release job
@@ -61,14 +61,16 @@ pipeline {
stage('Check oss.sonatype.org') {
steps {
// If this fails, an exception should be thrown and execution will halt
+ dir("${BASE_DIR}"){
script {
- def r = sh(label: "Check Maven status", script: "scripts/jenkins/check_maven.sh -u https://status.maven.org/api/v2/summary.json --component OSSRH", returnStatus: true)
+ def r = sh(label: "Check Maven status", script: "./scripts/jenkins/check_maven.sh -u https://status.maven.org/api/v2/summary.json --component OSSRH", returnStatus: true)
if (r == 1) {
error("Failing release build because Maven is the OSSRH component is not fully operational. See https://status.maven.org/ for more details.")
}
}
}
}
+ }
stage('Check master build status') {
when { expression { params.ignore_branch_ci_status } }
steps {
@@ -185,6 +187,7 @@ pipeline {
}
stage('Wait for artifact to be available in Maven Central') {
steps {
+ dir("${BASE_DIR}"){
script {
def fullUrl = sh(script: "./scripts/jenkins/maven_artifact_url.sh ")
echo "Sleeping for ten minutes to wait for Sonatype"
@@ -199,6 +202,7 @@ pipeline {
}
}
}
+ }
stage('Update Cloudfoundry') {
steps {
deleteDir()
@@ -214,21 +218,25 @@ pipeline {
stage('Publish release on GitHub') {
steps {
waitUntil(initialRecurrencePeriod: 60000) {
+ dir("${BASE_DIR}"){
script {
echo "Waiting for the release notes to be available"
- def ret = sh(script: "scripts/jenkins/docs_check.sh $TAG_VER")
+ def ret = sh(script: "./scripts/jenkins/docs_check.sh $TAG_VER")
return ret == 0
}
}
+ }
githubReleasePublish(id: "${env.RELEASE_ID}")
}
}
stage('Build and push Docker images') {
steps {
- sh(label: "Build Docker image", script: "scripts/jenkins/build_docker.sh")
+ dir("${BASE_DIR}"){
+ sh(label: "Build Docker image", script: "./scripts/jenkins/build_docker.sh")
// Get Docker registry credentials
dockerLogin(secret: "${ELASTIC_DOCKER_SECRET}", registry: 'docker.elastic.co')
- sh(label: "Push Docker image", script: "scripts/jenkins/push_docker.sh")
+ sh(label: "Push Docker image", script: "./scripts/jenkins/push_docker.sh")
+ }
}
}
}
