From e36897d3fc9e3b2e33bce73e5b4288a9b79ea683 Mon Sep 17 00:00:00 2001 From: vapao Date: Fri, 5 Jun 2020 21:21:44 +0800 Subject: [PATCH] =?UTF-8?q?F=20=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=E4=BF=9D=E7=95=99=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E4=B8=8D=E6=AD=A3=E7=A1=AE=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 92bbe40..2d169ce 100644 --- a/spug_api/apps/deploy/utils.py +++ b/spug_api/apps/deploy/utils.py @@ -141,7 +141,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}_* 2> /dev/null | tail -n +{extend.versions + 1} | xargs rm -rf' + clean_command = f'ls -d {extend.deploy_id}_* 2> /dev/null | sort -t _ -rnk2 | 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'