From ddc11d8d8bac849378bc54e7d22225ff587a1495 Mon Sep 17 00:00:00 2001 From: Rodrigo Antunes Date: Thu, 25 Jul 2024 10:29:16 -0300 Subject: [PATCH 1/2] Adjust git tag creation for Apache 10 release --- .ci/jenkins/Jenkinsfile.deploy | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index 8f32664d194..3399fbb35dc 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -82,7 +82,7 @@ pipeline { } stage('Prepare for PR') { when { - expression { return isRelease() || isCreatePr() } + expression { return isCreatePr() } } steps { script { @@ -149,7 +149,7 @@ pipeline { } stage('Create PR') { when { - expression { return isRelease() || isCreatePr() } + expression { return isCreatePr() } } steps { script { @@ -159,11 +159,6 @@ pipeline { } else { println '[WARN] no changes to commit' } - - // Create a new tag - githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId()) - githubscm.tagRepository(getGitTagName()) - githubscm.pushRemoteTag('origin', getGitTagName(), getGitAuthorPushCredsId()) } } } @@ -178,6 +173,30 @@ 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') + githubscm.findAndStageNotIgnoredFiles('antora.yml') + }) + } else { + println '[WARN] no changes to commit' + } + githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId()) + githubscm.tagRepository(getGitTagName()) + githubscm.pushRemoteTag('origin', getGitTagName(), getGitAuthorPushCredsId()) + } + } + } + } } post { always { From 5189aad5d4be08249eb7a5b9b39b50651eff3a4b Mon Sep 17 00:00:00 2001 From: Rodrigo Antunes Date: Thu, 25 Jul 2024 10:31:06 -0300 Subject: [PATCH 2/2] Adjust git tag creation for Apache 10 release --- .ci/jenkins/Jenkinsfile.deploy | 1 - 1 file changed, 1 deletion(-) diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index 3399fbb35dc..b503afb8ab5 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -190,7 +190,6 @@ pipeline { } else { println '[WARN] no changes to commit' } - githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId()) githubscm.tagRepository(getGitTagName()) githubscm.pushRemoteTag('origin', getGitTagName(), getGitAuthorPushCredsId()) }