Jenkinsfile 1.0 KB

1234567891011121314151617181920212223242526272829
  1. def git_auth="d4b4c06c-7a45-4969-a06d-8363858e81cd"
  2. def git_url="http://10.68.0.122:3000/fanyijian/k8s.git"
  3. def jenkins_home="/var/jenkins_home/workspace/k8s"
  4. def xy_image="registry-vpc.cn-beijing.aliyuncs.com/xinyue-jenkins"
  5. def release="${BUILD_NUMBER}"
  6. def projectList = project_name.split(",")
  7. def list2 = ['mchsrv','sharebms2']
  8. ansiColor('xterm') {
  9. node {
  10. stage('pull code') {
  11. echo "\u001B[32m############开始拉取代码############\u001B[0m"
  12. checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: "${git_auth}", url: "${git_url}"]]])
  13. }
  14. stage('build images') {
  15. for (int i = 0; i < projectList.length ; i++) {
  16. echo "\u001B[32m############正在build images,项目名为:${projectList[i]}############\u001B[0m"
  17. for (int j = 0 ; j < list2.size() ; j++) {
  18. if ("${projectList[i]}" == "${list2[j]}") {
  19. echo "11111111111"
  20. }else {
  21. echo "22222222222"
  22. }
  23. }
  24. }
  25. }
  26. }
  27. }