diff --git a/Jenkinsfile b/Jenkinsfile index 7647fdcd..39ed7f16 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,17 +1,15 @@ pipeline { agent any - // πŸ” VΓ©rifie toutes les 2 minutes si du nouveau code a Γ©tΓ© poussΓ© triggers { pollSCM('H/2 * * * *') } - // βš™οΈ ParamΓ¨tre manuel (fallback) parameters { choice( name: 'ENV', choices: ['dev', 'preprod', 'prod'], - description: 'Choisir l’environnement de dΓ©ploiement (automatique si branche correspondante)' + description: 'Choisir l’environnement de dΓ©ploiement' ) } @@ -22,9 +20,6 @@ pipeline { stages { - /* ─────────────────────────────── - * 1️⃣ Init β€” DΓ©tection automatique de l’environnement - * ─────────────────────────────── */ stage('Init') { steps { script { @@ -46,15 +41,11 @@ pipeline { πŸ“‚ Chemin de dΓ©ploiement = ${env.DEPLOY_PATH} """ - // VΓ©rifie le rΓ©pertoire cible sh "ls -l ${env.DEPLOY_PATH} || echo '⚠️ Dossier non accessible depuis Jenkins'" } } } - /* ─────────────────────────────── - * 2️⃣ Checkout du code - * ─────────────────────────────── */ stage('Checkout') { steps { echo "πŸ“¦ RΓ©cupΓ©ration du code source depuis Gitea..." @@ -62,9 +53,6 @@ pipeline { } } - /* ─────────────────────────────── - * 3️⃣ Tests & QualitΓ© (dans un conteneur Node.js) - * ─────────────────────────────── */ stage('Tests & QualitΓ©') { agent { docker { @@ -82,22 +70,16 @@ pipeline { } } - /* ─────────────────────────────── - * 4️⃣ Build de l’image Docker - * ─────────────────────────────── */ stage('Build Docker image') { steps { - echo "🐳 Construction de l’image Docker backend..." + echo "🐳 Construction de l’image Docker backend (no cache)..." sh """ - docker build -t ${REGISTRY_URL}/${IMAGE_NAME}:${TAG} . + docker build --no-cache -t ${REGISTRY_URL}/${IMAGE_NAME}:${TAG} . docker tag ${REGISTRY_URL}/${IMAGE_NAME}:${TAG} ${REGISTRY_URL}/${IMAGE_NAME}:latest """ } } - /* ─────────────────────────────── - * 5️⃣ Push vers le registre privΓ© - * ─────────────────────────────── */ stage('Push to Registry') { steps { echo "πŸ“€ Envoi de l’image vers le registre Docker privΓ©..." @@ -111,9 +93,6 @@ pipeline { } } - /* ─────────────────────────────── - * 6️⃣ Backup avant dΓ©ploiement - * ─────────────────────────────── */ stage('Backup Before Deploy') { steps { echo "πŸ’Ύ ExΓ©cution du script de sauvegarde avant dΓ©ploiement..." @@ -127,9 +106,6 @@ pipeline { } } - /* ─────────────────────────────── - * 7️⃣ DΓ©ploiement - * ─────────────────────────────── */ stage('Deploy') { steps { echo "πŸš€ DΓ©ploiement du backend sur ${env.ENV}..." @@ -156,7 +132,6 @@ pipeline { /* ─────────────────────────────── * 8️⃣ VΓ©rification de santΓ© (via /health) * ─────────────────────────────── */ - * ─────────────────────────────── */ stage('Health Check') { steps { echo "🩺 VΓ©rification du backend aprΓ¨s dΓ©ploiement..." @@ -182,9 +157,6 @@ pipeline { } } - /* ─────────────────────────────── - * πŸ”š Post Actions - * ─────────────────────────────── */ post { success { echo "βœ… Pipeline backend ${env.ENV} terminΓ© avec succΓ¨s !"