浏览代码

push_test

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()
             }
         }
     }