Commit c7563b2f authored by daidekun's avatar daidekun

try

parent 26b933f5
......@@ -21,12 +21,12 @@ def call(body) {
node {
stage('choice') {
env.RELEASE_ACTION = input message: 'User input required', ok: 'Release!',
parameters: [choice(name: 'RELEASE_SCOPE', choices: 'deploy\nnginx_add', description: 'What is the action?')]
echo "${env.RELEASE_ACTION}"
/* currentBuild.result = 'SUCCESS'*/
return
}
......@@ -41,17 +41,18 @@ def call(body) {
stage('Deploy') {
/*摘服务,看日志*/
sh "ansible-playbook /etc/ansible/nginx_remove.yml -e project_name=${project_name} -e room=${room} -e room_hosts=${hosts} -vv"
sh "ansible-playbook /etc/ansible/nginx_remove.yml -e project_name=${projectName} -e room=${room} -e room_hosts=${hosts} -vv"
/*判断*/
/*yes*/
sh "ansible-playbook /etc/ansible/deploy.yml -e project_name=${project_name} -e room=${room} -e room_hosts=${hosts} -vv"
/*no*/
/* ansible-playbook /etc/ansible/nginx_add.yml -e project_name=${project_name} -e room=${room} -e room_hosts=${hosts} -vv*/
env.RELEASE_ACTION = input message: '请选择下一步部署动作', ok: 'Release!',
parameters: [choice(name: 'RELEASE_SCOPE', choices: 'Deploy\nRollback', description: '请谨慎选择你要进行的操作')]
if (env.RELEASE_ACTION == "Deploy") {
sh "ansible-playbook /etc/ansible/deploy.yml -e project_name=${projectName} -e room=${room} -e room_hosts=${hosts} -vv"
}else{
sh "ansible-playbook /etc/ansible/nginx_add.yml -e project_name=${projectName} -e room=${room} -e room_hosts=${hosts} -vv"
}
echo "deploy"
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment