diff --git a/be/be-acp/cd-acp-backend.Jenkinsfile b/be/be-acp/cd-acp-backend.Jenkinsfile index 640ad40..922072f 100644 --- a/be/be-acp/cd-acp-backend.Jenkinsfile +++ b/be/be-acp/cd-acp-backend.Jenkinsfile @@ -21,8 +21,8 @@ pipeline { ANSIBLE_FOLDER_PATH = '/srv/ansible_v3' ANSIBLE_PLAYBOOK_PATH = 'playbooks/backend/deploy_acp_backend.yml' - TELEGRAM_CHAT_ID = -4678013464 - TELEGRAM_BOT_TOKEN = credentials('TELEGRAM_BOT_TOKEN') + SLACK_TOKEN = credentials('SLACK_TOKEN') + } stages { @@ -95,13 +95,15 @@ pipeline { success { script { def message = "✅ Deploy thành công : 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}\"" + 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}, ${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}""" + } } } diff --git a/be/be-acp/ci-production-acp-backend.Jenkinsfile b/be/be-acp/ci-production-acp-backend.Jenkinsfile index e59ff6d..e9351d7 100644 --- a/be/be-acp/ci-production-acp-backend.Jenkinsfile +++ b/be/be-acp/ci-production-acp-backend.Jenkinsfile @@ -31,8 +31,8 @@ pipeline { TIMESTAMP = new Date().format('yyyyMMdd.HH', TimeZone.getTimeZone('UTC')) FULL_VERSION = "${env.VERSION}-${env.TIMESTAMP}-${env.BUILD_NUMBER}" // Tạo phiên bản hoàn chỉnh - TELEGRAM_CHAT_ID = -4678013464 - TELEGRAM_BOT_TOKEN = credentials('TELEGRAM_BOT_TOKEN') + SLACK_TOKEN = credentials('SLACK_TOKEN') + } stages { @@ -126,13 +126,15 @@ pipeline { echo "Job '${env.JOB_NAME}' completed successfully. Attempting to trigger Job '${TRIGGER_JOB_NAME}'..." script { def message = "✅Build thành công : API - 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}\"" + 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 = "❌Build thất bại: API - Môi trường ${env.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}\"" + sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" + } } } diff --git a/be/be-acp/ci-uat-acp-backend.Jenkinsfile b/be/be-acp/ci-uat-acp-backend.Jenkinsfile index 1de8a4d..7454002 100644 --- a/be/be-acp/ci-uat-acp-backend.Jenkinsfile +++ b/be/be-acp/ci-uat-acp-backend.Jenkinsfile @@ -31,8 +31,8 @@ pipeline { TIMESTAMP = new Date().format('yyyyMMdd.HH', TimeZone.getTimeZone('UTC')) FULL_VERSION = "${env.VERSION}-${env.TIMESTAMP}-${env.BUILD_NUMBER}" // Tạo phiên bản hoàn chỉnh - TELEGRAM_CHAT_ID = -4678013464 - TELEGRAM_BOT_TOKEN = credentials('TELEGRAM_BOT_TOKEN') + SLACK_TOKEN = credentials('SLACK_TOKEN') + } stages { @@ -126,7 +126,8 @@ pipeline { echo "Job '${env.JOB_NAME}' completed successfully. Attempting to trigger Job '${TRIGGER_JOB_NAME}'..." script { def message = "✅Build thành công : API - 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}\"" + sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" + } script { try { @@ -148,7 +149,8 @@ pipeline { failure { script { def message = "❌Build thất bại: API - Môi trường ${env.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}\"" + sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" + } } } diff --git a/be/be-portal/cd-portal-backend.Jenkinsfile b/be/be-portal/cd-portal-backend.Jenkinsfile index 52dc1e2..2113775 100644 --- a/be/be-portal/cd-portal-backend.Jenkinsfile +++ b/be/be-portal/cd-portal-backend.Jenkinsfile @@ -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}""" + } } } diff --git a/be/be-portal/ci-production-portal-backend.Jenkinsfile b/be/be-portal/ci-production-portal-backend.Jenkinsfile index 6bfa0bc..7e7d698 100644 --- a/be/be-portal/ci-production-portal-backend.Jenkinsfile +++ b/be/be-portal/ci-production-portal-backend.Jenkinsfile @@ -31,8 +31,7 @@ pipeline { TIMESTAMP = new Date().format('yyyyMMdd.HH', TimeZone.getTimeZone('UTC')) FULL_VERSION = "${env.VERSION}-${env.TIMESTAMP}-${env.BUILD_NUMBER}" // Tạo phiên bản hoàn chỉnh - TELEGRAM_CHAT_ID = -4678013464 - TELEGRAM_BOT_TOKEN = credentials('TELEGRAM_BOT_TOKEN') + SLACK_TOKEN = credentials('SLACK_TOKEN') } stages { @@ -127,7 +126,8 @@ pipeline { echo "Job '${env.JOB_NAME}' completed successfully. Attempting to trigger Job '${TRIGGER_JOB_NAME}'..." script { def message = "✅Build thành công : API - 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}\"" + sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" + } } @@ -135,7 +135,8 @@ pipeline { failure { script { def message = "❌Build thất bại: API - Môi trường ${env.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}\"" + sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" + } } } diff --git a/be/be-portal/ci-uat-portal-backend.Jenkinsfile b/be/be-portal/ci-uat-portal-backend.Jenkinsfile index 74adbd4..a9c278a 100644 --- a/be/be-portal/ci-uat-portal-backend.Jenkinsfile +++ b/be/be-portal/ci-uat-portal-backend.Jenkinsfile @@ -31,8 +31,7 @@ pipeline { TIMESTAMP = new Date().format('yyyyMMdd.HH', TimeZone.getTimeZone('UTC')) FULL_VERSION = "${env.VERSION}-${env.TIMESTAMP}-${env.BUILD_NUMBER}" // Tạo phiên bản hoàn chỉnh - TELEGRAM_CHAT_ID = -4678013464 - TELEGRAM_BOT_TOKEN = credentials('TELEGRAM_BOT_TOKEN') + SLACK_TOKEN = credentials('SLACK_TOKEN') } stages { @@ -127,7 +126,8 @@ pipeline { echo "Job '${env.JOB_NAME}' completed successfully. Attempting to trigger Job '${TRIGGER_JOB_NAME}'..." script { def message = "✅Build thành công : API - 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}\"" + sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" + } script { def portalNames = ['ktdt', 'hnt'] @@ -151,7 +151,7 @@ pipeline { failure { script { def message = "❌Build thất bại: API - Môi trường ${env.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}\"" + sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" } } } diff --git a/be/be-resource/cd-resource-backend.Jenkinsfile b/be/be-resource/cd-resource-backend.Jenkinsfile index 8db08e3..5f97427 100644 --- a/be/be-resource/cd-resource-backend.Jenkinsfile +++ b/be/be-resource/cd-resource-backend.Jenkinsfile @@ -23,9 +23,6 @@ pipeline { ANSIBLE_FOLDER_PATH = '/srv/ansible_v3' - TELEGRAM_CHAT_ID = -4678013464 - TELEGRAM_BOT_TOKEN = credentials('TELEGRAM_BOT_TOKEN') - SLACK_TOKEN = credentials('SLACK_TOKEN') } @@ -107,7 +104,6 @@ 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}""" } @@ -115,7 +111,6 @@ pipeline { 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}""" } diff --git a/be/be-resource/ci-production-resource-backend.Jenkinsfile b/be/be-resource/ci-production-resource-backend.Jenkinsfile index 9da9b16..bade5e6 100644 --- a/be/be-resource/ci-production-resource-backend.Jenkinsfile +++ b/be/be-resource/ci-production-resource-backend.Jenkinsfile @@ -31,8 +31,7 @@ pipeline { TIMESTAMP = new Date().format('yyyyMMdd.HH', TimeZone.getTimeZone('UTC')) FULL_VERSION = "${env.VERSION}-${env.TIMESTAMP}-${env.BUILD_NUMBER}" // Tạo phiên bản hoàn chỉnh - TELEGRAM_CHAT_ID = -4678013464 - TELEGRAM_BOT_TOKEN = credentials('TELEGRAM_BOT_TOKEN') + SLACK_TOKEN = credentials('SLACK_TOKEN') } stages { @@ -127,12 +126,16 @@ pipeline { script { def message = "✅Build thành công : API - 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}\"" + 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 = "❌Build thất bại: API - Môi trường ${env.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}\"" + sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" + } } } diff --git a/be/be-resource/ci-uat-resource-backend.Jenkinsfile b/be/be-resource/ci-uat-resource-backend.Jenkinsfile index 61816e5..2c46c3d 100644 --- a/be/be-resource/ci-uat-resource-backend.Jenkinsfile +++ b/be/be-resource/ci-uat-resource-backend.Jenkinsfile @@ -31,9 +31,6 @@ pipeline { TIMESTAMP = new Date().format('yyyyMMdd.HH', TimeZone.getTimeZone('UTC')) FULL_VERSION = "${env.VERSION}-${env.TIMESTAMP}-${env.BUILD_NUMBER}" // Tạo phiên bản hoàn chỉnh - TELEGRAM_CHAT_ID = -4678013464 - TELEGRAM_BOT_TOKEN = credentials('TELEGRAM_BOT_TOKEN') - SLACK_TOKEN = credentials('SLACK_TOKEN') } @@ -128,7 +125,6 @@ pipeline { echo "Job '${env.JOB_NAME}' completed successfully. Attempting to trigger Job '${TRIGGER_JOB_NAME}'..." script { def message = "✅Build thành công : API - 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}\"" sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" } script { @@ -151,7 +147,6 @@ pipeline { failure { script { def message = "❌Build thất bại: API - Môi trường ${env.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}\"" sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" } diff --git a/fe/fe-acp/cd-acp-frontend.Jenkinsfile b/fe/fe-acp/cd-acp-frontend.Jenkinsfile index 2b5ed0d..15cd871 100644 --- a/fe/fe-acp/cd-acp-frontend.Jenkinsfile +++ b/fe/fe-acp/cd-acp-frontend.Jenkinsfile @@ -21,8 +21,7 @@ pipeline { ANSIBLE_FOLDER_PATH = '/srv/ansible_v3' ANSIBLE_PLAYBOOK_PATH = 'playbooks/frontend/deploy_acp_frontend.yml' - TELEGRAM_CHAT_ID = -4678013464 - TELEGRAM_BOT_TOKEN = credentials('TELEGRAM_BOT_TOKEN') + SLACK_TOKEN = credentials('SLACK_TOKEN') } stages { @@ -106,13 +105,15 @@ pipeline { success { script { def message = "✅Deploy thành công : FRONTEND - 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}\"" + 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: FRONTEND - 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}\"" + sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" + } } } diff --git a/fe/fe-acp/ci-production-acp-frontend.Jenkinsfile b/fe/fe-acp/ci-production-acp-frontend.Jenkinsfile index fa13132..b92f087 100644 --- a/fe/fe-acp/ci-production-acp-frontend.Jenkinsfile +++ b/fe/fe-acp/ci-production-acp-frontend.Jenkinsfile @@ -29,8 +29,8 @@ pipeline { TIMESTAMP = new Date().format('yyyyMMdd.HH', TimeZone.getTimeZone('UTC')) FULL_VERSION = "${env.VERSION}-${env.TIMESTAMP}-${env.BUILD_NUMBER}" // Tạo phiên bản hoàn chỉnh - TELEGRAM_CHAT_ID = -4678013464 - TELEGRAM_BOT_TOKEN = credentials('TELEGRAM_BOT_TOKEN') + SLACK_TOKEN = credentials('SLACK_TOKEN') + } stages { @@ -104,7 +104,8 @@ pipeline { echo "Job '${env.JOB_NAME}' completed successfully. Attempting to trigger Job '${TRIGGER_JOB_NAME}'..." script { 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}\"" + sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" + } script { try { @@ -126,7 +127,8 @@ pipeline { failure { script { def message = "❌Build thất bại: FRONTEND - Môi trường ${env.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}\"" + sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" + } } } diff --git a/fe/fe-acp/ci-uat-acp-frontend.Jenkinsfile b/fe/fe-acp/ci-uat-acp-frontend.Jenkinsfile index e0ee244..1947549 100644 --- a/fe/fe-acp/ci-uat-acp-frontend.Jenkinsfile +++ b/fe/fe-acp/ci-uat-acp-frontend.Jenkinsfile @@ -28,9 +28,8 @@ pipeline { TIMESTAMP = new Date().format('yyyyMMdd.HH', TimeZone.getTimeZone('UTC')) FULL_VERSION = "${env.VERSION}-${env.TIMESTAMP}-${env.BUILD_NUMBER}" // Tạo phiên bản hoàn chỉnh - - TELEGRAM_CHAT_ID = -4678013464 - TELEGRAM_BOT_TOKEN = credentials('TELEGRAM_BOT_TOKEN') + + SLACK_TOKEN = credentials('SLACK_TOKEN') } stages { @@ -107,7 +106,7 @@ pipeline { echo "Job '${env.JOB_NAME}' completed successfully. Attempting to trigger Job '${TRIGGER_JOB_NAME}'..." script { 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}\"" + sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" } script { try { @@ -129,7 +128,8 @@ pipeline { failure { script { def message = "❌Build thất bại: FRONTEND - Môi trường ${env.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}\"" + sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" + } } } diff --git a/fe/fe-portal/cd-portal-frontend.Jenkinsfile b/fe/fe-portal/cd-portal-frontend.Jenkinsfile index 06c3254..aff2387 100644 --- a/fe/fe-portal/cd-portal-frontend.Jenkinsfile +++ b/fe/fe-portal/cd-portal-frontend.Jenkinsfile @@ -21,8 +21,7 @@ pipeline { ANSIBLE_FOLDER_PATH = '/srv/ansible_v3' - TELEGRAM_CHAT_ID = -4678013464 - TELEGRAM_BOT_TOKEN = credentials('TELEGRAM_BOT_TOKEN') + SLACK_TOKEN = credentials('SLACK_TOKEN') } stages { @@ -114,13 +113,13 @@ pipeline { success { script { def message = "✅Deploy thành công : FRONTEND - 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: FRONTEND - 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}""" } } } diff --git a/fe/fe-portal/ci-production-portal-frontend.Jenkinsfile b/fe/fe-portal/ci-production-portal-frontend.Jenkinsfile index 29b9083..96ba96b 100644 --- a/fe/fe-portal/ci-production-portal-frontend.Jenkinsfile +++ b/fe/fe-portal/ci-production-portal-frontend.Jenkinsfile @@ -36,8 +36,8 @@ pipeline { TIMESTAMP = new Date().format('yyyyMMdd.HH', TimeZone.getTimeZone('UTC')) FULL_VERSION = "${env.VERSION}-${env.TIMESTAMP}-${env.BUILD_NUMBER}" // Tạo phiên bản hoàn chỉnh - TELEGRAM_CHAT_ID = -4678013464 - TELEGRAM_BOT_TOKEN = credentials('TELEGRAM_BOT_TOKEN') + SLACK_TOKEN = credentials('SLACK_TOKEN') + } stages { stage('Configure GIT_BRANCH') { @@ -131,7 +131,7 @@ pipeline { echo "Job '${env.JOB_NAME}' completed successfully. Attempting to trigger Job '${TRIGGER_JOB_NAME}'..." script { def message = "✅Build thành công : FRONTEND - Môi trường ${env.ENV} - Dự án ${env.PROJECT_NAME} - Portal_Name ${params.PORTAL_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}\"" + sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" } script { try { @@ -154,7 +154,7 @@ pipeline { failure { script { def message = "❌Build thất bại: FRONTEND - Môi trường ${env.ENV} - Dự án ${env.PROJECT_NAME} - Portal_Name ${params.PORTAL_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}\"" + sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" } } } diff --git a/fe/fe-portal/ci-uat-portal-frontend.Jenkinsfile b/fe/fe-portal/ci-uat-portal-frontend.Jenkinsfile index 7b24a6f..60b3481 100644 --- a/fe/fe-portal/ci-uat-portal-frontend.Jenkinsfile +++ b/fe/fe-portal/ci-uat-portal-frontend.Jenkinsfile @@ -36,8 +36,8 @@ pipeline { TIMESTAMP = new Date().format('yyyyMMdd.HH', TimeZone.getTimeZone('UTC')) FULL_VERSION = "${env.VERSION}-${env.TIMESTAMP}-${env.BUILD_NUMBER}" // Tạo phiên bản hoàn chỉnh - TELEGRAM_CHAT_ID = -4678013464 - TELEGRAM_BOT_TOKEN = credentials('TELEGRAM_BOT_TOKEN') + SLACK_TOKEN = credentials('SLACK_TOKEN') + } stages { stage('Configure GIT_BRANCH') { @@ -131,7 +131,7 @@ pipeline { echo "Job '${env.JOB_NAME}' completed successfully. Attempting to trigger Job '${TRIGGER_JOB_NAME}'..." script { def message = "✅Build thành công : FRONTEND - Môi trường ${env.ENV} - Dự án ${env.PROJECT_NAME} - Portal_Name ${params.PORTAL_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}\"" + sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" } script { try { @@ -155,7 +155,7 @@ pipeline { failure { script { def message = "❌Build thất bại: FRONTEND - Môi trường ${env.ENV} - Dự án ${env.PROJECT_NAME} - Site ${params.PORTAL_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}\"" + sh """curl -X POST -H 'Content-type: application/json' --data '{"text":"${message}"}' https://hooks.slack.com/services/T08TS987F4N/B08TS9SC2QN/${SLACK_TOKEN}""" } } }