From a9f122677ee4eb3cec096277a88240ca0b498a96 Mon Sep 17 00:00:00 2001 From: yuobrezkov Date: Wed, 9 Apr 2025 17:54:51 +0300 Subject: [PATCH 1/2] asdasdasdasd --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d25a344..afffc09 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -97,7 +97,8 @@ pipeline { http://git.entcor/api/v1/repos/deployer3000/${env.IMAGE_NAME}/pulls/${prId}/merge """ echo "PR ${prId} merged successfully into main!" - def commitHash = sh(script: "git rev-parse HEAD~1", returnStdout: true).trim() + def commitHash = sh(script: "git rev-parse HEAD~1", returnStdout: true).trim() + def newCommitHash = sh(script: "git rev-parse HEAD", returnStdout: true).trim() sh """ curl -v -X POST -u "${GITEA_USER}:${GITEA_PASS}" \ -H "Content-Type: application/json" \ From 7b2920acea12d527c3984578b1be0c6caff62172 Mon Sep 17 00:00:00 2001 From: yuobrezkov Date: Wed, 9 Apr 2025 17:55:48 +0300 Subject: [PATCH 2/2] 123asd --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index afffc09..e680049 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -98,11 +98,13 @@ pipeline { """ echo "PR ${prId} merged successfully into main!" def commitHash = sh(script: "git rev-parse HEAD~1", returnStdout: true).trim() - def newCommitHash = sh(script: "git rev-parse HEAD", returnStdout: true).trim() + def newCommitHash = sh(script: "git rev-parse HEAD", returnStdout: true).trim() + echo "COMMIT_HASH ${commitHash}" + ecoh "NEW_COMMIT_HASH ${newCommitHash}" 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": "${commitHash}"}' \ + -d '{"tag_name": "${env.NEW_VERSION}", "name": "Release ${env.NEW_VERSION}", "target_commitish": "${newCommitHash}"}' \ "${env.GITEA_REPOSITORY_URL}deployer3000/${env.IMAGE_NAME}/releases" """ echo "New release succeeded!"