Commit d00be93e authored by binta's avatar binta

update

parent 9f19d914
pipeline {
agent any
environment {
IMAGE_NAME = "registry.gitlab.com/binetaci/odoo-demo:latest"
CONFIG_FILE = "docker-config.json"
}
stages {
stage('Build') {
steps {
echo "Building Docker image..."
sh "docker build -t ${IMAGE_NAME} ."
}
}
/* stage('Push Image') {
steps {
echo "Pushing Docker image to GitLab Registry..."
withCredentials([usernamePassword(
credentialsId: 'gitlab-registry-credentials',
usernameVariable: 'USERNAME',
passwordVariable: 'PASSWORD'
)]) {
sh "docker login -u ${USERNAME} -p ${PASSWORD} registry.gitlab.com/binetaci"
sh "docker push ${IMAGE_NAME}"
}
}
}*/
stage('Push Image') {
steps {
echo "Pushing Docker image to GitLab Registry..."
// Copier le fichier docker-config.json dans le répertoire Docker
sh "mkdir -p ~/.docker"
sh "cp ${CONFIG_FILE} ~/.docker/config.json"
// Pousser l'image dans le registre
sh "docker push ${IMAGE_NAME}"
}
}
stage('Deploy with Helm') {
steps {
echo "Deploying application with Helm..."
sh """
helm upgrade --install odoo-deployment ./helm/ \
--set image.repository=registry.gitlab.com/binetaci \
--set image.tag=latest
"""
}
}
stage('ArgoCD Sync') {
steps {
echo "Triggering ArgoCD sync..."
sh "argocd app sync odoo-deployment"
}
}
}
post {
always {
echo "Pipeline completed!"
}
}
}
odoo-chart @ ac8871d7
Subproject commit ac8871d7f60761890052bdec965bb8ffdd83438f
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