1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
| pipeline { agent { kubernetes { label 'mypod' cloud 'kubernetes_jnlp' } } parameters { string(name:'repoUrl', defaultValue: 'http://git.galaxymx.com/yunwei/oms.git', description: 'git代码路径') string(name:'repoBranch', defaultValue: 'master', description: 'git分支名称') string(name:'pomPath', defaultValue: 'pom.xml', description: 'pom.xml的相对路径') string(name:'warLocation', defaultValue: '/data/app/war/target/*.war', description: 'war包的相对路径 ') choice(name: 'server',choices:'192.168.1.107,9090,*****,*****\n192.168.1.60,9090,*****,*****', description: '测试服务器列表选择(IP,JettyPort,Name,Passwd)') string(name:'dubboPort', defaultValue: '31100', description: '测试服务器的dubbo服务端口') string(name:'lineCoverage', defaultValue: '20', description: '单元测试代码覆盖率要求(%),小于此值pipeline将会失败!') booleanParam(name: 'isCommitQA',description: '是否邮件通知测试人员进行人工验收',defaultValue: false } environment def def def def } options buildDiscarder(logRotator(numToKeepStr: '10')) } triggers pollSCM('H 4 * * 1-5') } post{ success{ script wrap([$class: 'BuildUser']) { mail subject: "PineLine '${JOB_NAME}' (${BUILD_NUMBER}) result", body: "${BUILD_USER}'s pineline '${JOB_NAME}' (${BUILD_NUMBER}) run success\n请及时前往${env.BUILD_URL}进行查看" } } } failure{ script wrap([$class: 'BuildUser']) { mail subject: "PineLine '${JOB_NAME}' (${BUILD_NUMBER}) result", body: "${BUILD_USER}'s pineline '${JOB_NAME}' (${BUILD_NUMBER}) run failure\n请及时前往${env.BUILD_URL}进行查看" } }
} unstable{ script wrap([$class: 'BuildUser']) { mail subject: "PineLine '${JOB_NAME}' (${BUILD_NUMBER})结果", body: "${BUILD_USER}'s pineline '${JOB_NAME}' (${BUILD_NUMBER}) run unstable\n请及时前往${env.BUILD_URL}进行查看" } } } } stages stage('代码拉取'){ steps echo git } } stage('目录检查') { steps echo script{ def if skip return } } } } stage('nginx服务检查') { steps echo script{ def if skip return } } } } stage('tomcat服务检查') { steps echo script{ def if skip return } } } } stage('发布确认') { steps input } } stage('代码推送') { steps echo sh } } } }
|