Thienvv -

This commit is contained in:
thienqb123456
2024-12-24 18:09:00 +07:00
parent f15bbac142
commit 520fd9cb4d
4 changed files with 5 additions and 11 deletions
+1 -4
View File
@@ -75,10 +75,7 @@ pipeline {
post { post {
always { always {
// script { echo 'Pipeline execution finished.'
// def message = "Deploy : API - Môi trường ${params.ENV} - Dự án ${env.PROJECT_NAME}, ${currentBuild.fullDisplayName}\n${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}\""
// }
} }
success { success {
script { script {
+2 -2
View File
@@ -123,7 +123,7 @@ pipeline {
success { success {
echo "Job '${env.JOB_NAME}' completed successfully. Attempting to trigger Job '${TRIGGER_JOB_NAME}'..." echo "Job '${env.JOB_NAME}' completed successfully. Attempting to trigger Job '${TRIGGER_JOB_NAME}'..."
script { script {
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...!" def message = "Build thành công : API - 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}\"" 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 { script {
@@ -145,7 +145,7 @@ pipeline {
} }
failure { failure {
script { 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}." def message = "Build thất bại: API - 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}\"" 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}\""
} }
} }
+1 -4
View File
@@ -77,10 +77,7 @@ pipeline {
post { post {
always { always {
// script { echo 'Pipeline execution finished.'
// def message = "Build : API - Môi trường ${params.ENV} - Dự án ${env.PROJECT_NAME}, ${currentBuild.fullDisplayName}\n${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}\""
// }
} }
success { success {
script { script {
+1 -1
View File
@@ -149,7 +149,7 @@ pipeline {
failure { failure {
failure { failure {
script { 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}." def message = "Build thất bại: API - 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}\"" 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}\""
} }
} }