проверка2
test-org/test-ci-cd/pipeline/pr-main This commit looks good Details

pull/1/head
yuobrezkov 2025-04-09 14:58:37 +03:00
parent e418799850
commit ade7581080
1 changed files with 21 additions and 21 deletions

42
Jenkinsfile vendored
View File

@ -89,27 +89,27 @@ pipeline {
sh "rm -rf ${env.WORKSPACE}/rc/ || true"
}
}
success {
script {
if (env.CHANGE_BRANCH?.startsWith('rc')) {
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 -X POST \
-u "${GITEA_USER}:${GITEA_PASS}" \
-H "Content-Type: application/json" \
-d '{"do":"merge"}' \
http://git.entcor/api/v1/repos/deployer3000/trust-module-backend/pulls/${prId}/merge
"""
echo "PR ${prId} merged successfully into main!"
def context = "test-org/trust-module-backend/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, "trust-module-backend", commitHash, "success")
}
}
}
}
// success {
// script {
// if (env.CHANGE_BRANCH?.startsWith('rc')) {
// 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 -X POST \
// -u "${GITEA_USER}:${GITEA_PASS}" \
// -H "Content-Type: application/json" \
// -d '{"do":"merge"}' \
// http://git.entcor/api/v1/repos/deployer3000/trust-module-backend/pulls/${prId}/merge
// """
// echo "PR ${prId} merged successfully into main!"
// def context = "test-org/trust-module-backend/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, "trust-module-backend", commitHash, "success")
// }
// }
// }
// }
failure {
echo "Pipeline failed. Check the logs for details."
}