加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Jenkinsfile 1.60 KB
一键复制 编辑 原始数据 按行查看 历史
书生何谓天下 提交于 2020-09-30 19:08 . 提交代码
pipeline {
agent any
stages {
stage('pull') {
steps {
checkout([$class: 'GitSCM', branches: [[name: "*/${branch}"]],
doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [],
userRemoteConfigs: [[credentialsId: '9bc5f661-86ed-446c-b0b3-e41b364a39a2',
url: 'http://git.5kcrm.com/zhangzhiwei/wk_crm_single.git']]])
echo '拉取代码成功'
}
}
stage('build') {
steps {
script {
def apps = "${project_name}".split(",")
for (int i = 0; i < apps.size(); ++i) {
sh label: '', script: "sh package.sh ${apps[i]}"
echo " ${apps[i]} 打包成功"
}
}
}
}
stage('deploy') {
steps {
echo 'deploy'
withEnv(['JENKINS_NODE_COOKIE=dontkillme']) {
script {
def apps = "${project_name}".split(",")
for (int i = 0; i < apps.size(); ++i) {
sh label: '', script: "sh deploy.sh stop ${apps[i]}"
sh label: '', script: "sh deploy.sh copy ${apps[i]}"
sh label: '', script: "sh deploy.sh start ${apps[i]}"
echo " ${apps[i]} 部署成功"
}
}
}
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化