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

Update web

parent 6772403c
......@@ -64,11 +64,11 @@ pipeline {
stage('Send Notification to Google Chat') {
steps {
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 """
curl -X POST -H "Content-Type: application/json" \
-d '${message}' \
......@@ -80,19 +80,23 @@ pipeline {
}
post {
failure {
script {
def message = """
{
"text": "Échec du build #${env.BUILD_NUMBER} de l'image ${IMAGE_NAME}."
always {
cleanWs()
}
failure {
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