Commit 4bd5ba7b authored by binta's avatar binta

Mise à jour du Jenkinsfile et configuration

parent bb51299a
......@@ -2,11 +2,12 @@ pipeline {
agent any
environment {
DOCKER_CONFIG_PATH = "/path/to/docker-config.json" // ce fichier sera stocker dans le conteneur de jenkins au niveau du volume
DOCKER_REGISTRY = "registry.gitlab.com/votre-projet"
DOCKER_CONFIG_PATH = "/jenkins/docker-config.json" // Fichier monté dans le conteneur Jenkins
DOCKER_REGISTRY = "registry.gitlab.com/binetaci/image-odoo"
IMAGE_NAME = "odoo-app"
HELM_RELEASE = "odoo-release"
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 {
def message = """
{
"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 {
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}"
"""
}
}
}
}
......@@ -7,7 +7,7 @@ replicaCount: 1
# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
image:
repository: registry.gitlab.com/binetaci/odoo-demox
repository: registry.gitlab.com/binetaci/odoo-demo
# This sets the pull policy for images.
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
......
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