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")
fabfile.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录