Kaynağa Gözat

更新 'Jenkinsfile'

chenghongxi 4 yıl önce
ebeveyn
işleme
adc77c5bd0
1 değiştirilmiş dosya ile 10 ekleme ve 2 silme
  1. 10 2
      Jenkinsfile

+ 10 - 2
Jenkinsfile

@@ -7,7 +7,7 @@ def projectList = project_name.split(",")
 
 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']]])}
+        checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: ${git_auth}, url: ${git_url}]]])}
     stage('build images') {
         for (int i = 0; i < projectList.length ; i++) {
              echo "正在build images,项目名为:${projectList[i]}"
@@ -16,8 +16,16 @@ node {
     }
     stage('push aliyuncs registry') {
          for (int i = 0; i < projectList.length ; i++) {
-              sh "echo 正在推送镜像,项目名为:${projectList[i]} " 
+              echo "正在推送镜像,项目名为:${projectList[i]} " 
               sh "docker push ${xy_image}${projectList[i]}:${BUILD_NUMBER}"
         }
     }
+	stage('Release && check'){
+		for (int i = 0; i < projectList.length ; i++) {
+		cd ${jenkins_home}
+		chmod +x ${jenkins_home}jenkins.py
+		python3 jenkins.py
+		"""
+        }
+	}
 }