formation 11 ヶ月 前
コミット
dc568d9409
1 ファイル変更6 行追加8 行削除
  1. 6 8
      Jenkinsfile

+ 6 - 8
Jenkinsfile

@@ -89,20 +89,18 @@ pipeline {
         //     }
         // }
 
-       stage('Docker Registry Login and Pull') {
+      stage('Docker Registry Login, Pull, and Push') {
     when {
         branch 'master'
     }
     steps {
         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
-                    }
-                """
+                // Pull image
+                docker.image('nexus.foodgame.fr:8123/fatboar_master_apache_preprod:latest').pull()
+                
+                // Push image
+                docker.image('nexus.foodgame.fr:8123/fatboar_master_apache_preprod:latest').push()
             }
         }
     }