Commit c59887b7 authored by Mame Bineta Diakite's avatar Mame Bineta Diakite

Update web

parent 6772403c
...@@ -64,11 +64,11 @@ pipeline { ...@@ -64,11 +64,11 @@ pipeline {
stage('Send Notification to Google Chat') { stage('Send Notification to Google Chat') {
steps { steps {
script { script {
def message = ''' def message = """
{ {
"text": "Build de l'image terminé avec succès : ${IMAGE_NAME}." "text": "Pipeline completed successfully for build #${env.BUILD_NUMBER} of ${IMAGE_NAME}."
} }
''' """
sh """ sh """
curl -X POST -H "Content-Type: application/json" \ curl -X POST -H "Content-Type: application/json" \
-d '${message}' \ -d '${message}' \
...@@ -80,19 +80,23 @@ pipeline { ...@@ -80,19 +80,23 @@ pipeline {
} }
post { post {
failure { always {
script { cleanWs()
def message = """ }
{ failure {
"text": "Échec du build #${env.BUILD_NUMBER} de l'image ${IMAGE_NAME}." script {
def message = """
{
"text": "Pipeline failed for build #${env.BUILD_NUMBER} of ${IMAGE_NAME}. Please check the logs."
}
"""
sh """
curl -X POST -H "Content-Type: application/json" \
-d '${message}' \
"${GOOGLE_CHAT_WEBHOOK}"
"""
} }
"""
sh """
curl -X POST -H "Content-Type: application/json" \
-d '${message.replace("'", "\\'")}' \
"${GOOGLE_CHAT_WEBHOOK}"
"""
} }
} }
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment