From 6d7daff25e3c7bdd9367b9314e103954e11a26a3 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 12 Sep 2022 12:24:41 +0100 Subject: [PATCH 1/2] release: configure git user globally --- .ci/release/Jenkinsfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.ci/release/Jenkinsfile b/.ci/release/Jenkinsfile index 87e0f6befa..3899f3e39b 100644 --- a/.ci/release/Jenkinsfile +++ b/.ci/release/Jenkinsfile @@ -45,9 +45,7 @@ pipeline { credentialsId: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba', shallow: false ) - dir("${BASE_DIR}") { - setupAPMGitEmail() - } + setupAPMGitEmail(global: true) dir("${BASE_DIR}") { withEnv(["BRANCH_NAME=${BRANCH_SPECIFIER}"]){ withGitRelease() { // sets up the git release setup (remote branches, current workspace state, ...) From 89d11c4732d4da4097a705f73ca047f798dc5d3d Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 12 Sep 2022 13:13:00 +0100 Subject: [PATCH 2/2] release: ensure the user to be used for committing the version --- .ci/release/Jenkinsfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.ci/release/Jenkinsfile b/.ci/release/Jenkinsfile index 3899f3e39b..d01b7b2a5f 100644 --- a/.ci/release/Jenkinsfile +++ b/.ci/release/Jenkinsfile @@ -45,10 +45,12 @@ pipeline { credentialsId: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba', shallow: false ) - setupAPMGitEmail(global: true) dir("${BASE_DIR}") { withEnv(["BRANCH_NAME=${BRANCH_SPECIFIER}"]){ withGitRelease() { // sets up the git release setup (remote branches, current workspace state, ...) + // Set the git user/email to be used, otherwise withGitRelease will pick up the latest + // git committer. + setupAPMGitEmail() stash(allowEmpty: true, name: 'source', useDefaultExcludes: false) } } @@ -127,6 +129,7 @@ pipeline { echo "changing project version from '${snapshot_version}' to '${user_release_version}' to prepare release ${user_release_version}." sh(label: "mavenVersionUpdate", script: "./mvnw --batch-mode release:update-versions -DdevelopmentVersion=${user_release_version}-SNAPSHOT") sh(script: "git commit -a -m 'Version bump ${user_release_version}'") + sh(label: 'debug git user', script: 'git --no-pager log -1') gitPush() }