проверка2
test-org/test-ci-cd/pipeline/pr-main This commit looks good
Details
test-org/test-ci-cd/pipeline/pr-main This commit looks good
Details
parent
e418799850
commit
ade7581080
|
|
@ -89,27 +89,27 @@ pipeline {
|
||||||
sh "rm -rf ${env.WORKSPACE}/rc/ || true"
|
sh "rm -rf ${env.WORKSPACE}/rc/ || true"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
success {
|
// success {
|
||||||
script {
|
// script {
|
||||||
if (env.CHANGE_BRANCH?.startsWith('rc')) {
|
// if (env.CHANGE_BRANCH?.startsWith('rc')) {
|
||||||
echo "Attempting to merge PR ${env.CHANGE_ID} into master..."
|
// echo "Attempting to merge PR ${env.CHANGE_ID} into master..."
|
||||||
withCredentials([usernamePassword(credentialsId: 'gitea_creds', usernameVariable: 'GITEA_USER', passwordVariable: 'GITEA_PASS')]) {
|
// withCredentials([usernamePassword(credentialsId: 'gitea_creds', usernameVariable: 'GITEA_USER', passwordVariable: 'GITEA_PASS')]) {
|
||||||
def prId = env.CHANGE_ID
|
// def prId = env.CHANGE_ID
|
||||||
sh """
|
// sh """
|
||||||
curl -X POST \
|
// curl -X POST \
|
||||||
-u "${GITEA_USER}:${GITEA_PASS}" \
|
// -u "${GITEA_USER}:${GITEA_PASS}" \
|
||||||
-H "Content-Type: application/json" \
|
// -H "Content-Type: application/json" \
|
||||||
-d '{"do":"merge"}' \
|
// -d '{"do":"merge"}' \
|
||||||
http://git.entcor/api/v1/repos/deployer3000/trust-module-backend/pulls/${prId}/merge
|
// http://git.entcor/api/v1/repos/deployer3000/trust-module-backend/pulls/${prId}/merge
|
||||||
"""
|
// """
|
||||||
echo "PR ${prId} merged successfully into main!"
|
// echo "PR ${prId} merged successfully into main!"
|
||||||
def context = "test-org/trust-module-backend/pipeline/pr-${env.CHANGE_TARGET}"
|
// def context = "test-org/trust-module-backend/pipeline/pr-${env.CHANGE_TARGET}"
|
||||||
def commitHash = sh(script: "git rev-parse HEAD~1", returnStdout: true).trim()
|
// 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")
|
// notify(context, GITEA_USER, GITEA_PASS, env.GITEA_REPOSITORY_URL, "trust-module-backend", commitHash, "success")
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
failure {
|
failure {
|
||||||
echo "Pipeline failed. Check the logs for details."
|
echo "Pipeline failed. Check the logs for details."
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue