From 480c85e305df2dda8c81d123a3a09f79c482512c Mon Sep 17 00:00:00 2001 From: vapao Date: Wed, 5 Feb 2020 15:22:59 +0800 Subject: [PATCH] =?UTF-8?q?F=20=E4=BF=AE=E5=A4=8DmacOS=E4=B8=BB=E6=9C=BA?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_api/apps/deploy/utils.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/spug_api/apps/deploy/utils.py b/spug_api/apps/deploy/utils.py index 183cbd1..818cb69 100644 --- a/spug_api/apps/deploy/utils.py +++ b/spug_api/apps/deploy/utils.py @@ -10,7 +10,6 @@ import socket import subprocess import json import uuid -import sys import os REPOS_DIR = settings.REPOS_DIR @@ -149,12 +148,7 @@ def _deploy_ext1_host(helper, h_id, extend, env): # do deploy helper.send_step(h_id, 3, f'{human_time()} 执行发布... ') - tmp_path = os.path.join(extend.dst_repo, f'tmp_{env.SPUG_VERSION}') - if sys.platform == 'darwin': - command = f'rm -f {extend.dst_dir} && ln -sfn {repo_dir} {extend.dst_dir}' - else: - command = f'ln -sfn {repo_dir} {tmp_path} && mv -fT {tmp_path} {extend.dst_dir}' - helper.remote(host.id, ssh, command) + helper.remote(host.id, ssh, f'rm -f {extend.dst_dir} && ln -sfn {repo_dir} {extend.dst_dir}') helper.send_step(h_id, 3, '完成\r\n') # post host