U 改进update命令

pull/103/head
vapao 2020-05-20 19:00:45 +08:00
parent c6ca897bec
commit dd63077c8b
1 changed files with 2 additions and 1 deletions

View File

@ -37,7 +37,7 @@ class Command(BaseCommand):
# update api
commands = [
f'cd {settings.BASE_DIR}',
'git fetch --tags',
f'git fetch origin refs/tags/{version}:refs/tags/{version} --no-tags',
f'git checkout {version}'
]
task = subprocess.Popen(' && '.join(commands), shell=True)
@ -59,5 +59,6 @@ class Command(BaseCommand):
call_command('migrate')
self.stdout.write(self.style.SUCCESS('''升级成功,请自行重启服务,如果通过官方文档安装一般重启命令为
Docker: docker restart $CONTAINER_ID
Centos: systemctl restart supervisord
Ubuntu: systemctl restart supervisor'''))