sua cicd
This commit is contained in:
@@ -128,22 +128,6 @@ pipeline {
|
||||
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}\""
|
||||
}
|
||||
script {
|
||||
try {
|
||||
def buildResult = build job: "${TRIGGER_JOB_NAME}", parameters:[
|
||||
string(name: 'ENV', value: env.ENV),
|
||||
string(name: 'CI_JOB_BUILD_NUMBER', value: env.BUILD_NUMBER)
|
||||
],
|
||||
propagate: false
|
||||
if (buildResult.result != 'SUCCESS') {
|
||||
echo "[WARNING] Job 2 failed with result: ${buildResult.result}"
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
echo "[ERROR] Failed to trigger job: ${TRIGGER_JOB_NAME}. Error: ${e.message}"
|
||||
throw e
|
||||
}
|
||||
}
|
||||
}
|
||||
failure {
|
||||
script {
|
||||
|
||||
@@ -129,18 +129,6 @@ pipeline {
|
||||
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}\""
|
||||
}
|
||||
script {
|
||||
try {
|
||||
build job: "${TRIGGER_JOB_NAME}", parameters:[
|
||||
string(name: 'ENV', value: env.ENV),
|
||||
string(name: 'CI_JOB_BUILD_NUMBER', value: env.BUILD_NUMBER)
|
||||
], propagate: false
|
||||
}
|
||||
catch (Exception e) {
|
||||
echo "[ERROR] Failed to trigger job: ${TRIGGER_JOB_NAME}. Error: ${e.message}"
|
||||
throw e
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
failure {
|
||||
|
||||
@@ -130,12 +130,16 @@ pipeline {
|
||||
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 {
|
||||
def portalNames = ['ktdt', 'hnt']
|
||||
try {
|
||||
for (portal in portalNames) {
|
||||
build job: "${TRIGGER_JOB_NAME}", parameters:[
|
||||
string(name: 'ENV', value: env.ENV),
|
||||
string(name: 'PORTAL_NAME', value: portal),
|
||||
string(name: 'CI_JOB_BUILD_NUMBER', value: env.BUILD_NUMBER)
|
||||
], propagate: false
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
echo "[ERROR] Failed to trigger job: ${TRIGGER_JOB_NAME}. Error: ${e.message}"
|
||||
throw e
|
||||
|
||||
@@ -128,22 +128,6 @@ pipeline {
|
||||
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}\""
|
||||
}
|
||||
script {
|
||||
try {
|
||||
def buildResult = build job: "${TRIGGER_JOB_NAME}", parameters:[
|
||||
string(name: 'ENV', value: env.ENV),
|
||||
string(name: 'CI_JOB_BUILD_NUMBER', value: env.BUILD_NUMBER)
|
||||
],
|
||||
propagate: false
|
||||
if (buildResult.result != 'SUCCESS') {
|
||||
echo "[WARNING] Job 2 failed with result: ${buildResult.result}"
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
echo "[ERROR] Failed to trigger job: ${TRIGGER_JOB_NAME}. Error: ${e.message}"
|
||||
throw e
|
||||
}
|
||||
}
|
||||
}
|
||||
failure {
|
||||
script {
|
||||
|
||||
Reference in New Issue
Block a user