From af5854fc3339cd398a33d4e6fb39c30c3c3baff3 Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Thu, 25 Jun 2020 18:57:25 +0530 Subject: [PATCH] refactor: backup site_config.json closes #282 --- build/common/commands/push_backup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build/common/commands/push_backup.py b/build/common/commands/push_backup.py index d1e3803c..2e08441a 100644 --- a/build/common/commands/push_backup.py +++ b/build/common/commands/push_backup.py @@ -13,7 +13,8 @@ def get_file_ext(): return { "database": "-database.sql.gz", "private_files": "-private-files.tar", - "public_files": "-files.tar" + "public_files": "-files.tar", + "site_config": "-site_config_backup.json" } @@ -177,7 +178,9 @@ def main(): upload_file_to_s3(db_file, folder, conn, bucket) # Archive site_config.json - site_config_file = os.path.join(os.getcwd(), site, 'site_config.json') + site_config_file = details.get('site_config', {}).get('file_path') + if not site_config_file: + site_config_file = os.path.join(os.getcwd(), site, 'site_config.json') upload_file_to_s3(site_config_file, folder, conn, bucket) public_files = details.get('public_files', {}).get('file_path')