Fix git checkout error
@@ -43,7 +43,7 @@ pipeline {
dir("${BASE_DIR}") {
setupAPMGitEmail()
}
- stash(allowEmpty: true, name: 'source', useDefaultExcludes: false)
+
dir("${BASE_DIR}") {
script {
env.TAG_BARE = sh(script: "./scripts/jenkins/tags.sh bare", returnStdout: true)
@@ -51,6 +51,13 @@ pipeline {
env.TAG_DOT_X = sh(script: "./scripts/jenkins/tags.sh dot_x", returnStdout: true)
}
}
+ withEnv(["BRANCH_NAME=tags/${env.TAG_BARE}"]){
+ withGitRelease() {
+ stash(allowEmpty: true, name: 'source', useDefaultExcludes: false)
+ }
+ }
+ deleteDir()
+ unstash 'source'
}
}
}
@@ -119,12 +126,8 @@ pipeline {
]
)
sh(label: "mavenVersionUpdate", script: "./mvnw --batch-mode release:update-versions -DdevelopmentVersion=${new_version}")
- withEnv(["BRANCH_NAME=tags/${env.TAG_BARE}"]){
- withGitRelease() {
sh(script: "git commit -a -m 'Version bump'")
gitPush()
- }
- }
} else {
echo "Skipping version update"
}
@@ -154,9 +157,6 @@ pipeline {
stage('Branch creation') {
steps {
dir("${BASE_DIR}") {
- git credentialsId: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba', url: 'git@github.com:elastic/apm-agent-java.git'
- withEnv(["BRANCH_NAME=tags/${env.TAG_BARE}"]){
- withGitRelease() {
script {
def curVer = mvnVersion()
sh(script: "./scripts/jenkins/branch_creation.sh ${curVer}")
@@ -169,12 +169,8 @@ pipeline {
}
}
}
- }
- }
stage('Create GitHub release draft') {
steps {
- deleteDir()
- unstash 'source'
dir("${BASE_DIR}"){
script {
def curVer = mvnVersion(showQualifiers: false)
@@ -209,18 +205,12 @@ pipeline {
}
stage('Update Cloudfoundry') {
steps {
- deleteDir()
- unstash 'source'
dir("${BASE_DIR}"){
- withEnv(["BRANCH_NAME=tags/${env.TAG_BARE}"]){
- withGitRelease() {
sh(script: "./scripts/jenkins/update_cloudfoundry.sh")
gitPush()
}
}
}
- }
- }
stage('Publish release on GitHub') {
steps {
waitUntil(initialRecurrencePeriod: 60000) {
