Skip to content

Commit

Permalink
Adjust git tag creation for Apache 10 release (#3592)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigonull authored Jul 29, 2024
1 parent 72f5a73 commit 87feb69
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pipeline {
}
stage('Prepare for PR') {
when {
expression { return isRelease() || isCreatePr() }
expression { return isCreatePr() }
}
steps {
script {
Expand Down Expand Up @@ -160,7 +160,6 @@ pipeline {
mavenCommand.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
.run("clean $installOrDeploy")
}

}
}
}
Expand All @@ -175,7 +174,7 @@ pipeline {
}
stage('Create PR') {
when {
expression { return isRelease() || isCreatePr() }
expression { return isCreatePr() }
}
steps {
script {
Expand All @@ -185,11 +184,6 @@ pipeline {
} else {
println '[WARN] no changes to commit'
}

// Create a new tag
githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId())
githubscm.tagRepository(getGitTagName())
githubscm.pushRemoteTag('origin', getGitTagName(), getGitAuthorPushCredsId())
}
}
}
Expand All @@ -204,6 +198,26 @@ pipeline {
}
}
}
stage('Commit and Create Tag') {
when {
expression { return isRelease() }
}
steps {
script {
dir(getRepoName()) {
if (githubscm.isThereAnyChanges()) {
def commitMsg = "[${getBuildBranch()}] Update version to ${getProjectVersion()}"
githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId())
githubscm.commitChanges(commitMsg, { githubscm.findAndStageNotIgnoredFiles('pom.xml') })
} else {
println '[WARN] no changes to commit'
}
githubscm.tagRepository(getGitTagName())
githubscm.pushRemoteTag('origin', getGitTagName(), getGitAuthorPushCredsId())
}
}
}
}
}
post {
always {
Expand Down

0 comments on commit 87feb69

Please sign in to comment.