Commit 9f84b218 authored by daidekun's avatar daidekun

rollback

parent 29982ba6
......@@ -28,22 +28,40 @@ def call(body) {
*/ }
stage('Deploy') {
arr_machines = machines.split(",")
count = arr_machines.size()
int_count = (count / 2).toInteger()
machines_list = _utils.partList(arr_machines.toList(), int_count, count)
for (machine in machines_list) {
echo "Is deploy to :" + machine
sh "ansible-playbook /etc/ansible/service.yml -e project_name=${envType}.${projectName} -e data_center=${dataCenter} -e machines=${machine[0]} -e force=${force} -vv"
when {
expression {
return action == 'deploy';
}
}
steps {
echo 'deploy'
arr_machines = machines.split(",")
count = arr_machines.size()
int_count = (count / 2).toInteger()
machines_list = _utils.partList(arr_machines.toList(), int_count, count)
env.RELEASE_ACTION = input '是否继续部署?'
for (machine in machines_list) {
echo "Is deploy to :" + machine
sh "ansible-playbook /etc/ansible/service.yml -e project_name=${envType}.${projectName} -e data_center=${dataCenter} -e machines=${machine[0]} -e force=${force} -vv"
env.RELEASE_ACTION = input '是否继续部署?'
if (env.RELEASE_ACTION == true) {
sh "ansible-playbook /etc/ansible/${action}.yml -e project_name=${envType}.${projectName} -e data_center=${dataCenter} -e machines=${machine[0]} -e force=${force} -vv"
if (env.RELEASE_ACTION == true) {
sh "ansible-playbook /etc/ansible/${action}.yml -e project_name=${envType}.${projectName} -e data_center=${dataCenter} -e machines=${machine[0]} -e force=${force} -vv"
}
}
}
when {
expression {
return action == 'rollback';
}
}
steps {
echo 'rollback'
}
}
}
}
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