Thienvv - tach branch part 3
This commit is contained in:
@@ -52,7 +52,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
// Checkout mã nguồn từ Gitea
|
||||
@@ -142,13 +141,13 @@ pipeline {
|
||||
success {
|
||||
echo "Job '${env.JOB_NAME}' completed successfully. Attempting to trigger Job '${TRIGGER_JOB_NAME}'..."
|
||||
script {
|
||||
def message = "✅Build thành công : API - Dự án ${env.PROJECT_NAME} \n ${currentBuild.fullDisplayName}\n${env.BUILD_URL} \n Đang tiến hành Deploy...!"
|
||||
def message = "✅Build thành công : API - Môi trường ${params.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: 'uat'),
|
||||
string(name: 'ENV', value: params.ENV),
|
||||
string(name: 'CI_JOB_BUILD_NUMBER', value: env.BUILD_NUMBER)
|
||||
],
|
||||
propagate: false
|
||||
@@ -164,7 +163,7 @@ pipeline {
|
||||
}
|
||||
failure {
|
||||
script {
|
||||
def message = "❌Build thất bại: API - Dự án ${env.PROJECT_NAME} \n ${currentBuild.fullDisplayName}\n Kiểm tra tại đây ${env.BUILD_URL}."
|
||||
def message = "❌Build thất bại: API - Môi trường ${params.ENV} - Dự án ${env.PROJECT_NAME} \n ${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}\""
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user