Download media as well as db

This commit is contained in:
Gabriel Augendre 2021-12-28 12:26:17 +01:00
parent 766c881928
commit b679986434

View file

@ -42,10 +42,9 @@ def deploy(ctx):
@task @task
def download_db(ctx): def download_db(ctx):
with ctx.cd(BASE_DIR): with ctx.cd(BASE_DIR):
ctx.run( ctx.run("scp ubuntu:/home/gaugendre/blog/db/db.sqlite3 ./db/db.sqlite3")
"scp ubuntu:/home/gaugendre/blog/db/db.sqlite3 ./db/db.sqlite3", ctx.run("rm -rf src/media/")
pty=True, ctx.run("scp -r ubuntu:/home/gaugendre/blog/media/ ./src/media")
)
with ctx.cd(SRC_DIR): with ctx.cd(SRC_DIR):
ctx.run("./manage.py two_factor_disable gaugendre", pty=True) ctx.run("./manage.py two_factor_disable gaugendre", pty=True)
ctx.run("./manage.py changepassword gaugendre", pty=True) ctx.run("./manage.py changepassword gaugendre", pty=True)