formation il y a 11 mois
Parent
commit
b1fdc4d8ea
1 fichiers modifiés avec 16 ajouts et 17 suppressions
  1. 16 17
      Jenkinsfile

+ 16 - 17
Jenkinsfile

@@ -26,12 +26,12 @@ pipeline {
             }
         }
 
-        stage('Checkout Code') {
-            steps {
-                deleteDir()
-                checkout scm
-            }
-        }
+        // stage('Checkout Code') {
+        //     steps {
+        //         deleteDir()
+        //         checkout scm
+        //     }
+        // }
 
         // stage('SonarQube Analysis') {
         //     steps {
@@ -94,17 +94,16 @@ pipeline {
         branch 'master'
     }
     steps {
-        withCredentials([usernamePassword(
-            credentialsId: 'nexus'
-        )]) {
-            sh """
-                docker login nexus.foodgame.fr:8123 -u admin -p azerty10
-                docker pull nexus.foodgame.fr:8123/fatboar_master_express_preprod:latest || \
-                docker pull nexus.foodgame.fr:8123/fatboar_master_express_preprod || {
-                    echo "Failed to pull image"
-                    exit 1
-                }
-            """
+        script {
+            docker.withRegistry('https://nexus.foodgame.fr:8123', 'nexus') {
+                sh """
+                    docker pull nexus.foodgame.fr:8123/fatboar_master_apache_preprod:latest || \
+                    docker pull nexus.foodgame.fr:8123/fatboar_master_apache_preprod || {
+                        echo "Failed to pull image"
+                        exit 1
+                    }
+                """
+            }
         }
     }
 }