game.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:astoptool 作者: zouliuyun 项目源码 文件源码
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")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号