From 096c90854c005586920ea720bf8da221691f13eb Mon Sep 17 00:00:00 2001 From: yuobrezkov Date: Wed, 9 Apr 2025 16:23:41 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=BE=D0=B2=D0=B5=D1=80=D1=88=D0=B5?= =?UTF-8?q?=D0=BD=D0=BD=D0=BE=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D1=80?= =?UTF-8?q?=D0=B5=D0=BB=D0=B8=D0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 184781e..91a810d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -82,12 +82,13 @@ pipeline { script { if (env.CHANGE_BRANCH?.startsWith('rc')) { echo "Attempting to merge PR ${env.CHANGE_ID} into master..." + def commitHash = sh(script: "git rev-parse HEAD~1", returnStdout: true).trim() withCredentials([usernamePassword(credentialsId: 'gitea_creds', usernameVariable: 'GITEA_USER', passwordVariable: 'GITEA_PASS')]) { def prId = env.CHANGE_ID sh """ curl -v -X POST -u "${GITEA_USER}:${GITEA_PASS}" \ -H "Content-Type: application/json" \ - -d '{"tag_name": "${env.NEW_VERSION}", "name": "Release ${env.NEW_VERSION}", "target_commitish": "${env.GIT_COMMIT}"}' \ + -d '{"tag_name": "${env.NEW_VERSION}", "name": "Release ${env.NEW_VERSION}", "target_commitish": "${commitHash}"}' \ "${env.GITEA_REPOSITORY_URL}deployer3000/${env.IMAGE_NAME}/releases" """ echo "New release succeeded!" @@ -101,7 +102,6 @@ pipeline { """ echo "PR ${prId} merged successfully into main!" def context = "test-org/${env.IMAGE_NAME}/pipeline/pr-${env.CHANGE_TARGET}" - def commitHash = sh(script: "git rev-parse HEAD~1", returnStdout: true).trim() notify(context, GITEA_USER, GITEA_PASS, env.GITEA_REPOSITORY_URL, env.IMAGE_NAME, commitHash, "success") } }