add dry-run flag to upgrade command

This commit is contained in:
Moritz 2024-03-19 16:48:34 +01:00
parent fc7846c55c
commit 3b062342e5
1 changed files with 4 additions and 2 deletions

View File

@ -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)