U 常规发布在回滚时将跳过部分步骤以提高速度

pull/103/head
vapao 2020-05-28 18:06:30 +08:00
parent 1e9ec8ebb1
commit ad5a11dd81
1 changed files with 41 additions and 37 deletions

View File

@ -60,6 +60,9 @@ def _ext1_deploy(req, helper, env):
else:
tree_ish = extras[1]
env.update(SPUG_TAG=extras[1])
if req.type == '2':
helper.send_step('local', 6, f'完成\r\n{human_time()} 回滚发布... 跳过')
else:
helper.local(f'cd {REPOS_DIR} && rm -rf {req.deploy_id}_*')
helper.send_step('local', 1, '完成\r\n')
@ -132,6 +135,7 @@ def _deploy_ext1_host(helper, h_id, extend, env):
helper.send_error(h_id, 'no such host')
env.update({'SPUG_HOST_ID': h_id, 'SPUG_HOST_NAME': host.hostname})
ssh = host.get_ssh()
if env.SPUG_DEPLOY_TYPE != '2':
code, _ = ssh.exec_command(f'mkdir -p {extend.dst_repo} && [ -e {extend.dst_dir} ] && [ ! -L {extend.dst_dir} ]')
if code == 0:
helper.send_error(host.id, f'please make sure the {extend.dst_dir!r} is not exists.')