Commit 4ee507dc authored by Khady Diagne's avatar Khady Diagne

Update Jenkinsfileargo

parent 32adfa57
...@@ -9,7 +9,6 @@ pipeline { ...@@ -9,7 +9,6 @@ pipeline {
stages { stages {
stage('Cloning Git') { stage('Cloning Git') {
steps { steps {
// Cloner le dépôt Git contenant le Dockerfile et l'application Odoo
git([url: 'https://gitlab.baamtu.com/diopbe/odoo-demo.git', branch: 'khady']) git([url: 'https://gitlab.baamtu.com/diopbe/odoo-demo.git', branch: 'khady'])
} }
} }
...@@ -17,8 +16,7 @@ pipeline { ...@@ -17,8 +16,7 @@ pipeline {
stage('Building Docker Image') { stage('Building Docker Image') {
steps { steps {
script { script {
// Construire l'image Docker pour l'application Odoo dockerImage = docker.build("${imagename}:${BUILD_NUMBER}", ".")
dockerImage = docker.build(imagename, ".")
} }
} }
} }
...@@ -26,9 +24,8 @@ pipeline { ...@@ -26,9 +24,8 @@ pipeline {
stage('Push Docker Image') { stage('Push Docker Image') {
steps { steps {
script { script {
// Pousser l'image Docker vers Docker Hub
docker.withRegistry('', registryCredential) { docker.withRegistry('', registryCredential) {
dockerImage.push("$BUILD_NUMBER") dockerImage.push("${BUILD_NUMBER}")
dockerImage.push('latest') dockerImage.push('latest')
} }
} }
...@@ -38,8 +35,11 @@ pipeline { ...@@ -38,8 +35,11 @@ pipeline {
stage('ArgoCD Deployment') { stage('ArgoCD Deployment') {
steps { steps {
script { script {
// Appliquer le fichier YAML pour le déploiement avec ArgoCD try {
bat 'kubectl apply -f argocd_deploy.yaml --validate=false' bat 'kubectl apply -f argocd_deploy.yaml --validate=false'
} catch (Exception e) {
error "Deployment failed: ${e.message}"
}
} }
} }
} }
...@@ -47,7 +47,6 @@ pipeline { ...@@ -47,7 +47,6 @@ pipeline {
stage('Verify Deployment') { stage('Verify Deployment') {
steps { steps {
script { script {
// Vérifier que les ressources Kubernetes sont correctement déployées
bat 'kubectl get all -n default' bat 'kubectl get all -n default'
bat 'kubectl get pv' bat 'kubectl get pv'
bat 'kubectl get pvc' bat 'kubectl get pvc'
......
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