test_env_mobile_www_sync.py 文件源码

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

项目:astoptool 作者: zouliuyun 项目源码 文件源码
def sync(game, region):
    """
    ????????????????
    """
    conf = ConfigReader(game, region)
    ip = conf.get("mobile_www_ip")

    if conf.has_option("mobile_www_port"):
        """
        ????????????ssh?????????Fabric?????host???
        """
        port = conf.getint("mobile_www_port")     
        if port:
            ip = '{}:{}'.format(ip, port)

    root_dir_prod = conf.get("mobile_www_root")
    root_dir_test = conf.get("mobile_www_root_test")

    exclude_files = ['proxy.lua', 'lyServers']

    exclude_param = ' '.join(['--exclude={}'.format(each) for each in exclude_files])

    with settings(host_string=ip):
        run('''rsync -aqP --delete {exclude} {root_dir_prod}/ {root_dir_test}/'''.format(exclude=exclude_param, root_dir_prod=root_dir_prod, root_dir_test=root_dir_test))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号