def remove(self, remote_dir=None):
"""????????????????(nginx, backstage)"""
if remote_dir is None:
release_type = 'game_backup'
remote_dir = '/app/opbak/{}_{}'.format(release_type, TIMESTAMP)
self.stop()
self.mkdir(remote_dir)
with settings(host_string=self.int_ip):
with cd('/app'):
run('mv {} {}/'.format(self.name, remote_dir))
with cd(remote_dir):
run('pandora --dump --opt -R {0}>{0}.sql.rb{1}'.format(self.name, TIMESTAMP))
run('mv /app/nginx/conf/vhost/{}.conf ./'.format(self.name))
reload_nginx()
run('pandora --update -e "DROP DATABASE {}"'.format(self.name))
with cd('/app/{}_backstage'.format(self.game)):
run('cp socket_gameserver.ini {}/'.format(remote_dir))
run("sudo -u agent sed -i '/\\b{}\\b/d' socket_gameserver.ini".format(self.name))
run("set -m; sudo -u agent /bin/bash start.sh restart")
评论列表
文章目录