From 5d34b4af9b10b27c566358d6ded0c6f50c442da7 Mon Sep 17 00:00:00 2001 From: yuobrezkov Date: Wed, 9 Apr 2025 16:00:46 +0300 Subject: [PATCH 1/2] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D0=B0=201003?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 043440e..22e7e3e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -93,7 +93,7 @@ pipeline { """ echo "PR ${prId} merged successfully into main!" sh """ - curl -X POST -u "${GITEA_USER}:${GITEA_PASS}" \ + 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}"}' \ "${env.GITEA_REPOSITORY_URL}deployer3000/${env.IMAGE_NAME}/releases" -- 2.40.1 From 21b65ed3bd84e6274806c7d70544e3e650905abd Mon Sep 17 00:00:00 2001 From: yuobrezkov Date: Wed, 9 Apr 2025 16:01:07 +0300 Subject: [PATCH 2/2] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D0=B0=201004?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 22e7e3e..4d5a1e7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -84,6 +84,14 @@ pipeline { echo "Attempting to merge PR ${env.CHANGE_ID} into master..." 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}"}' \ + "${env.GITEA_REPOSITORY_URL}deployer3000/${env.IMAGE_NAME}/releases" + """ + echo "New release succeeded!" + sh """ curl -X POST \ -u "${GITEA_USER}:${GITEA_PASS}" \ @@ -92,13 +100,6 @@ pipeline { http://git.entcor/api/v1/repos/deployer3000/${env.IMAGE_NAME}/pulls/${prId}/merge """ echo "PR ${prId} merged successfully into main!" - 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}"}' \ - "${env.GITEA_REPOSITORY_URL}deployer3000/${env.IMAGE_NAME}/releases" - """ - echo "New release succeeded!" 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") -- 2.40.1