Parcourir la source

更新 'Jenkinsfile'

chenghongxi il y a 4 ans
Parent
commit
7d483f43ed
1 fichiers modifiés avec 9 ajouts et 14 suppressions
  1. 9 14
      Jenkinsfile

+ 9 - 14
Jenkinsfile

@@ -5,7 +5,6 @@ def xy_image="registry-vpc.cn-beijing.aliyuncs.com/xinyue-jenkins"
 def release="${BUILD_NUMBER}"
 def projectList = project_name.split(",")
 def sharev2name = ['mchsrv','sharebms2','sharebms2-nginx','sharesrv2']
-def sharev2list = sharev2name.split(",")
 def logonsvrlist = ['login-app-jl','login-app-lj','login-app-ln','login-mp','login-mp-gf','login-mp-intl','login-websocket','login-websocket-gf','登陆服务器-提审','登陆服务器-测试专用']
 
 ansiColor('xterm') {
@@ -16,19 +15,15 @@ ansiColor('xterm') {
 		}
 		stage('build images') {
 			for (int i = 0; i < projectList.length ; i++) {
-					for (int j = 0 ; j < sharev2list.length ; j++) {
-						echo "\u001B[32m############正在build images,项目名为:${projectList[i]}###${sharev2list[j]} ############\u001B[0m"
-						if ("${projectList[i]}" == "${sharev2list[j]}") {
-							sh "docker build -t ${xy_image}/${projectList[i]}:${release} -f ${jenkins_home}/share-v2/${projectList[i]}/Dockerfile ${jenkins_home}/share-v2/${projectList[i]}"
-							echo "11111111111111111111111111"
-						} else if ("${projectList[j]}" == "${sharev2list[i]}") {
-							sh "docker build -t ${xy_image}/${projectList[i]}:${release} -f ${jenkins_home}/logonsvr/${projectList[i]}/Dockerfile ${jenkins_home}/logonsvr/${projectList[i]}"
-						} else {
-							echo "222222222222"
-							sh "docker build -t ${xy_image}/${projectList[i]}:${release} -f ${jenkins_home}/${projectList[i]}/Dockerfile ${jenkins_home}/${projectList[i]}"
-						}
-					}
-			}      
+				echo "\u001B[32m############正在build images,项目名为:${projectList[i]}############\u001B[0m"
+				if ("${projectList[i]}" == "mchsrv" || "${projectList[i]}" == "sharebms2" || "${projectList[i]}" == "sharebms2-nginx" || "${projectList[i]}" == "sharesrv2") {
+						sh "docker build -t ${xy_image}/${projectList[i]}:${release} -f ${jenkins_home}/share-v2/${projectList[i]}/Dockerfile ${jenkins_home}/share-v2/${projectList[i]}"
+				} else if ("${projectList[i]}" == "login-app-jl" || "${projectList[i]}" == "login-app-lj" || "${projectList[i]}" == "login-app-ln" || "${projectList[i]}" == "login-mp" ||"${projectList[i]}" == "login-mp" ||"${projectList[i]}" == "login-mp-gf" || "${projectList[i]}" == "login-mp-intl" || "${projectList[i]}" == "login-websocket" || "${projectList[i]}" == "login-websocket-gf" || "${projectList[i]}" == "登陆服务器-提审" || "${projectList[i]}" == "登陆服务器-测试专用"){
+					
+				} else {
+					sh "docker build -t ${xy_image}${projectList[i]}:${release} -f ${jenkins_home}${projectList[i]}/Dockerfile ${jenkins_home}${projectList[i]}"
+				}
+			} 
 		}
 	}
 }