testEnvRelease.py 文件源码

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

项目:astoptool 作者: zouliuyun 项目源码 文件源码
def update_backend(gameServer, version, mainland=True):
    backup_dir = '/app/opbak/{}/{}'.format(TIME, gameServer)
    run(''' [ -d {0} ] || mkdir -p {0} '''.format(backup_dir))
    with cd('/app/{}/backend/apps'.format(gameServer)):
        for conf_file in ['app.properties', 'plugins.xml']:
            #check if the config exists
            with quiet():
                conf_exists = run('test -f {}'.format(conf_file)).succeeded

            if conf_exists:
                run('cp {} {}/'.format(conf_file, backup_dir))
                if mainland:
                    cmd = ''' sed -i '/http:\/\/.*\/%s/s/%stest_[0-9]\{1,3\}-[0-9]\{1,3\}-[0-9]\{1,3\}/%s/g' %s ''' % (GAME, GAME, version, conf_file)
                else:
                    cmd = ''' sed -i '/http:\/\/.*\/%s/s/%stest_[a-z]\{2,5\}_[0-9]\{1,3\}-[0-9]\{1,3\}-[0-9]\{1,3\}/%s/g' %s ''' % (GAME, GAME, version, conf_file)

                run(cmd)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号