From 09d211b1d1fc2e27265dd9cfa4338a279b7570a6 Mon Sep 17 00:00:00 2001 From: Rodrigo Antunes Date: Mon, 9 Sep 2024 18:32:21 -0300 Subject: [PATCH 1/2] Fix Git tag created in the weekly deploy Jenkins Job execution --- .ci/jenkins/Jenkinsfile.weekly.deploy | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.ci/jenkins/Jenkinsfile.weekly.deploy b/.ci/jenkins/Jenkinsfile.weekly.deploy index dcde5ce02e4..22c14eae4c9 100644 --- a/.ci/jenkins/Jenkinsfile.weekly.deploy +++ b/.ci/jenkins/Jenkinsfile.weekly.deploy @@ -157,8 +157,14 @@ pipeline { steps { script { projectVersion = getProjectVersion(false) - dir(optaplannerFolder) { - githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId()) + dir(optaplannerFolder)) { + if (githubscm.isThereAnyChanges()) { + def commitMsg = "[${getBuildBranch()}] Update version to ${projectVersion}" + githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId()) + githubscm.commitChanges(commitMsg, { githubscm.findAndStageNotIgnoredFiles('pom.xml') }) + } else { + println '[WARN] no changes to commit' + } githubscm.tagRepository(projectVersion) githubscm.pushRemoteTag('origin', projectVersion, getGitAuthorPushCredsId()) } From f33e67050de4db7c53e28f3e2094c9e3c951e107 Mon Sep 17 00:00:00 2001 From: Rodrigo Antunes Date: Mon, 9 Sep 2024 18:34:00 -0300 Subject: [PATCH 2/2] Fix typo --- .ci/jenkins/Jenkinsfile.weekly.deploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/jenkins/Jenkinsfile.weekly.deploy b/.ci/jenkins/Jenkinsfile.weekly.deploy index 22c14eae4c9..58d3fda179b 100644 --- a/.ci/jenkins/Jenkinsfile.weekly.deploy +++ b/.ci/jenkins/Jenkinsfile.weekly.deploy @@ -157,7 +157,7 @@ pipeline { steps { script { projectVersion = getProjectVersion(false) - dir(optaplannerFolder)) { + dir(optaplannerFolder) { if (githubscm.isThereAnyChanges()) { def commitMsg = "[${getBuildBranch()}] Update version to ${projectVersion}" githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId())