From b679986434086d7357414f4ad6fc6228c8f93b5c Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Tue, 28 Dec 2021 12:26:17 +0100 Subject: [PATCH] Download media as well as db --- tasks.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tasks.py b/tasks.py index 1f6080c..12536c9 100644 --- a/tasks.py +++ b/tasks.py @@ -42,10 +42,9 @@ def deploy(ctx): @task def download_db(ctx): with ctx.cd(BASE_DIR): - ctx.run( - "scp ubuntu:/home/gaugendre/blog/db/db.sqlite3 ./db/db.sqlite3", - pty=True, - ) + ctx.run("scp ubuntu:/home/gaugendre/blog/db/db.sqlite3 ./db/db.sqlite3") + ctx.run("rm -rf src/media/") + ctx.run("scp -r ubuntu:/home/gaugendre/blog/media/ ./src/media") with ctx.cd(SRC_DIR): ctx.run("./manage.py two_factor_disable gaugendre", pty=True) ctx.run("./manage.py changepassword gaugendre", pty=True)