From e6ab1abe63a2cb6e0fbb513ebfca5411c640cbd3 Mon Sep 17 00:00:00 2001 From: vapao Date: Sun, 19 Jan 2020 13:31:14 +0800 Subject: [PATCH] =?UTF-8?q?F=20=E4=BF=AE=E5=A4=8D=E9=A6=96=E6=AC=A1?= =?UTF-8?q?=E5=B8=B8=E8=A7=84=E5=8F=91=E5=B8=83=E6=98=BE=E7=A4=BA=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_api/apps/deploy/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spug_api/apps/deploy/utils.py b/spug_api/apps/deploy/utils.py index 4b411bf..3d4e5d5 100644 --- a/spug_api/apps/deploy/utils.py +++ b/spug_api/apps/deploy/utils.py @@ -126,7 +126,7 @@ def _deploy_ext1_host(helper, h_id, extend, env): if code == 0: helper.send_error(host.id, f'please make sure the {extend.dst_dir!r} is not exists.') # clean - clean_command = f'ls -rd {extend.deploy_id}_* | tail -n +{extend.versions + 1} | xargs rm -rf' + clean_command = f'ls -rd {extend.deploy_id}_* 2> /dev/null | tail -n +{extend.versions + 1} | xargs rm -rf' helper.remote(host.id, ssh, f'cd {extend.dst_repo} && rm -rf {env.SPUG_VERSION} && {clean_command}') # transfer files tar_gz_file = f'{env.SPUG_VERSION}.tar.gz'