This commit is contained in:
thienqb123456
2025-01-14 14:59:04 +07:00
parent df992aa54e
commit 70b7590269
2 changed files with 32 additions and 32 deletions
@@ -109,22 +109,22 @@ pipeline {
def message = "Build thành công : FRONTEND - Môi trường ${env.ENV} - Dự án ${env.PROJECT_NAME} \n ${currentBuild.fullDisplayName}\n${env.BUILD_URL} \n Đang tiến hành Deploy...!"
sh "curl -s -X POST https://api.telegram.org/bot${env.TELEGRAM_BOT_TOKEN}/sendMessage -d chat_id=${env.TELEGRAM_CHAT_ID} -d text=\"${message}\""
}
script {
try {
def buildResult = build job: "${TRIGGER_JOB_NAME}", parameters:[
string(name: 'ENV', value: env.ENV),
string(name: 'CI_JOB_BUILD_NUMBER', value: env.BUILD_NUMBER)
],
propagate: false
if (buildResult.result != 'SUCCESS') {
echo "[WARNING] Job 2 failed with result: ${buildResult.result}"
}
}
catch (Exception e) {
echo "[ERROR] Failed to trigger job: ${TRIGGER_JOB_NAME}. Error: ${e.message}"
throw e
}
}
// script {
// try {
// def buildResult = build job: "${TRIGGER_JOB_NAME}", parameters:[
// string(name: 'ENV', value: env.ENV),
// string(name: 'CI_JOB_BUILD_NUMBER', value: env.BUILD_NUMBER)
// ],
// propagate: false
// if (buildResult.result != 'SUCCESS') {
// echo "[WARNING] Job 2 failed with result: ${buildResult.result}"
// }
// }
// catch (Exception e) {
// echo "[ERROR] Failed to trigger job: ${TRIGGER_JOB_NAME}. Error: ${e.message}"
// throw e
// }
// }
}
failure {
script {