KUBE_CONTEXT="docker"// Contexte docker sera utilisé vu que j'utilise conteneur pour jenkins
HELM_RELEASE="chart-odoo"
KUBE_CONTEXT="minikube"// Contexte Kubernetes utilisé
GOOGLE_CHAT_WEBHOOK="https://chat.googleapis.com/v1/spaces/AAAACNlaIpk/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=RuFeBsALb8RwwvnHGneayfHq1r5fMc6rUtoKLlQr-DA"// Remplacez par votre webhook
}
stages{
...
...
@@ -36,7 +37,7 @@ pipeline {
}
}
}
// la configuration du deploiement avec helm et argo est deja effectue il reste l'image a builder pour jenkins afin d'avoir l'application sur argo
stage('Deploy with Helm'){
steps{
script{
...
...
@@ -59,11 +60,42 @@ pipeline {
}
}
}
stage('Send Notification to Google Chat'){
steps{
script{
defmessage="""
{
"text": "Pipeline completed successfully for build #${env.BUILD_NUMBER} of ${IMAGE_NAME}."
}
"""
sh"""
curl -X POST -H "Content-Type: application/json" \
-d '${message}' \
"${GOOGLE_CHAT_WEBHOOK}"
"""
}
}
}
}
post{
always{
cleanWs()
}
failure{
script{
defmessage="""
{
"text": "Pipeline failed for build #${env.BUILD_NUMBER} of ${IMAGE_NAME}. Please check the logs."
}
"""
sh"""
curl -X POST -H "Content-Type: application/json" \