Thienvv - bỏ telegram , đổi sang slack
This commit is contained in:
@@ -21,8 +21,8 @@ pipeline {
|
||||
|
||||
ANSIBLE_FOLDER_PATH = '/srv/ansible_v3'
|
||||
|
||||
TELEGRAM_CHAT_ID = -4678013464
|
||||
TELEGRAM_BOT_TOKEN = credentials('TELEGRAM_BOT_TOKEN')
|
||||
SLACK_TOKEN = credentials('SLACK_TOKEN')
|
||||
|
||||
}
|
||||
|
||||
stages {
|
||||
@@ -103,13 +103,15 @@ pipeline {
|
||||
success {
|
||||
script {
|
||||
def message = "✅Deploy thành công : API - Môi trường ${params.ENV} - Dự án ${env.PROJECT_NAME} - Portal_Name ${params.PORTAL_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}\""
|
||||
sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}"""
|
||||
|
||||
}
|
||||
}
|
||||
failure {
|
||||
script {
|
||||
def message = "❌Deploy thất bại: API - Môi trường ${params.ENV} - Dự án ${env.PROJECT_NAME} - Portal_Name ${params.PORTAL_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}\""
|
||||
sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}"""
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user