fabfile.py 文件源码

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

项目:CommunityCellularManager 作者: facebookincubator 项目源码 文件源码
def refresh_staging_db():
    """ [deploy] Delete staging DB and clone current prod DB. """
    cmd = ("aws rds delete-db-instance --db-instance-identifier staging \
            --skip-final-snapshot")

    # if this fails, db doesn't exist, so just continue
    with settings(warn_only=True):
        local(cmd, capture=True)

    puts("Waiting for DB to be deleted...")
    while True:
        cmd = "aws rds describe-db-instances --db-instance-identifier staging"
        with settings(warn_only=True):
            # This will keep returning a success until the DB is deleted.
            if local(cmd, capture=True).failed:
                break
        time.sleep(30)
    clonedb("elephant", "staging")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号