From 3b062342e5e8197d17762c2cd637ee1fa267ba38 Mon Sep 17 00:00:00 2001 From: Moritz Date: Tue, 19 Mar 2024 16:48:34 +0100 Subject: [PATCH] add dry-run flag to upgrade command --- alakazam.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/alakazam.py b/alakazam.py index 66ce070..169dc77 100755 --- a/alakazam.py +++ b/alakazam.py @@ -548,7 +548,8 @@ def deploy(apps, run_cmds, force, converge_checks): @cli.command() @click.option('-a', '--apps', multiple=True) @click.option('-r', '--run-cmds', is_flag=True) -def upgrade(apps, run_cmds): +@click.option('-d', '--dry-run', is_flag=True) +def upgrade(apps, run_cmds, dry_run): """ Deploy all the apps """ deployed_domains = get_deployed_apps(apps) for _, instance_config in CONFIGS.items(): @@ -578,7 +579,8 @@ def upgrade(apps, run_cmds): print(f"{domain} is already at version {version}") continue print(f'upgrade {domain} from version {deployed_version} to version "{version}"') - print(abra("app", *cmd)) + if not dry_run: + print(abra("app", *cmd)) if run_cmds: logging.info(f'execute commands for {domain}') execute_cmds(app_config)