From c1f8bdb85207af7476d5c5ebf944ec871dd8450e Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Thu, 6 Jun 2024 17:13:07 -0400 Subject: [PATCH] chore: multi_deploy --- tubular/scripts/frontend_multi_deploy.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tubular/scripts/frontend_multi_deploy.py b/tubular/scripts/frontend_multi_deploy.py index a6b57d5b..da60c10e 100755 --- a/tubular/scripts/frontend_multi_deploy.py +++ b/tubular/scripts/frontend_multi_deploy.py @@ -22,6 +22,10 @@ @click.command("frontend_deploy") +@click.option( + '--common-config-file', + help='File from which common configuration variables are read.', +) @click.option( '--env-config-file', help='File from which to read environment configuration variables.', @@ -40,27 +44,30 @@ is_flag=True, help='Boolean to decide if Cloudflare cache needs to be purged or not.', ) -def frontend_deploy(env_config_file, app_name, app_dist, purge_cache): +def frontend_deploy(common_config_file, env_config_file, app_name, app_dist, purge_cache): """ Copies a frontend application to an s3 bucket. Args: + common_config_file (str): Path to a YAML file containing common configuration variables. env_config_file (str): Path to a YAML file containing environment configuration variables. app_name (str): Name of the frontend app. app_dist (str): Path to frontend application dist directory. purge_cache (bool): Should Cloudflare cache needs to be purged. """ - if not env_config_file: - FAIL(1, 'Environment config file was not specified.') if not app_name: FAIL(1, 'Frontend application name was not specified.') if not app_dist: FAIL(1, 'Frontend application dist path was not specified.') + if not common_config_file: + FAIL(1, 'Common config file was not specified.') + if not env_config_file: + FAIL(1, 'Environment config file was not specified.') # We are deploying ALL sites to a single bucket so they live at # // within the global bucket. - deployer = FrontendDeployer(env_config_file, app_name) + deployer = FrontendDeployer(common_config_file, env_config_file, app_name) bucket_name = deployer.env_cfg.get('BUCKET_NAME') if not bucket_name: FAIL(1, 'No S3 bucket name configured for {}.'.format(app_name))