Browse Source

更新 'Jenkinsfile'

chenghongxi 4 years ago
parent
commit
317c914f3a
1 changed files with 7 additions and 12 deletions
  1. 7 12
      Jenkinsfile

+ 7 - 12
Jenkinsfile

@@ -8,17 +8,12 @@ node {
     stage('pull code') {
         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') {
-        sh "cd ${jenkins_home}${project_name}"
-        sh "docker build -t ${xy_image}${project_name}:${release} -f ${jenkins_home}${project_name}/Dockerfile ${jenkins_home}${project_name}"
-    }
-    stage('push aliyuncs registry') {
-        sh "docker push ${xy_image}${project_name}:${BUILD_NUMBER}"
-    }
-    stage('Release && check'){
-		sh """
-		cd ${jenkins_home}
-		chmod +x ${jenkins_home}jenkins.py
-		python3 jenkins.py
+        sh """
+		for projects_name in ${project_name}
+		do
+        cd ${jenkins_home}${project_name}
+        docker build -t ${xy_image}${project_name}:${release} -f ${jenkins_home}${project_name}/Dockerfile ${jenkins_home}${project_name}
+		done
 		"""
-	}
+    }
 }