Procházet zdrojové kódy

更新 'Jenkinsfile'

chenghongxi před 4 roky
rodič
revize
2251b38074
1 změnil soubory, kde provedl 5 přidání a 1 odebrání
  1. 5 1
      Jenkinsfile

+ 5 - 1
Jenkinsfile

@@ -10,9 +10,13 @@ node {
         checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'd4b4c06c-7a45-4969-a06d-8363858e81cd', url: 'http://10.68.0.122:3000/fanyijian/k8s.git']]])}
     stage('build images') {
         for (int i = 0; i < projectList.length ; i++) {
-             echo "${projectList[i]}"
              sh "echo 正在build images,项目名为:${projectList[i]} "
              sh "docker build -t ${xy_image}${projectList[i]}:${release} -f ${jenkins_home}${projectList[i]}/Dockerfile ${jenkins_home}${projectList[i]}"
         }      
     }
+    stage('stage('push aliyuncs registry') {
+         for (int i = 0; i < projectList.length ; i++) {
+              sh "docker push ${xy_image}${projectList[i]}:${BUILD_NUMBER}"')
+        }
+    }
 }