Thienvv -

This commit is contained in:
thienqb123456
2024-12-24 17:56:55 +07:00
parent b079599e1c
commit d0918a250d
3 changed files with 27 additions and 8 deletions
+8 -1
View File
@@ -121,6 +121,8 @@ pipeline {
}
success {
echo "Job '${env.JOB_NAME}' completed successfully. Attempting to trigger Job '${TRIGGER_JOB_NAME}'..."
def message = "Build thành công : API - Môi trường ${params.ENV} - Dự án ${env.PROJECT_NAME} ${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:[
@@ -140,7 +142,12 @@ pipeline {
}
failure {
echo 'Pipeline failed!'
failure {
script {
def message = "Build thất bại: API - Môi trường ${params.ENV} - Dự án ${env.PROJECT_NAME}, ${currentBuild.fullDisplayName}\n Kiểm tra tại đây ${env.BUILD_URL}."
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}\""
}
}
}
}
}