From 672281f5c6c1c4326ea6840c9368e5e6041d62d5 Mon Sep 17 00:00:00 2001 From: Philip Gaber Date: Wed, 16 Jul 2025 12:35:00 +0200 Subject: [PATCH] chore: Flush external, formatting, new cluster --- od-cli.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/od-cli.py b/od-cli.py index fdf1216..c6eb5b2 100755 --- a/od-cli.py +++ b/od-cli.py @@ -14,16 +14,17 @@ app = typer.Typer() gl = gitlab.Gitlab( url=os.environ.get("OD_GL_URL", ""), private_token=os.environ.get("OD_GL_TOKEN", "") ) -MASTER_PASSWORD = os.environ.get( - "OD_MASTER_PASSWORD", "sovereign-workplace" -) +MASTER_PASSWORD = os.environ.get("OD_MASTER_PASSWORD", "sovereign-workplace") USER = os.environ.get("OD_USER", "od-user") GL_USER = os.environ.get("OD_GL_USER", "od-gl-user") GL_PROJECT = os.environ.get("OD_GL_PROJECT", "1317") + class Clusters(StrEnum): qa = "qa" run = "run" + b1_stackit_butterfly = "b1-stackit-butterfly" + class Apps(StrEnum): all = "all" @@ -89,7 +90,8 @@ def new_pipeline( test: bool = False, test_branch: str = "develop", ee: bool = False, - env_stop: bool = True, + env_stop: bool = False, + flush_external: bool = False, debug: bool = True, default_accounts: bool = True, deploy: Annotated[List[Apps], typer.Option(case_sensitive=False)] = [Apps.none], @@ -102,6 +104,7 @@ def new_pipeline( f"NAMESPACE:{namespace}", f"MASTER_PASSWORD_WEB_VAR:{MASTER_PASSWORD}", f"ENV_STOP_BEFORE:{_tf_to_yn(env_stop)}", + f"FLUSH_EXTERNAL_SERVICES_BEFORE:{_tf_to_yn(flush_external)}", f"RUN_TESTS:{_tf_to_yn(test)}", f"TESTS_BRANCH:{test_branch}", f"DEBUG_ENABLED:{_tf_to_yn(debug)}", @@ -109,6 +112,12 @@ def new_pipeline( f"OPENDESK_ENTERPRISE:{'true' if ee else 'false'}", ] + if not env_stop and flush_external: + print( + f"WARNING: env_stop is {env_stop} AND flush_external is {flush_external}", + "but flush_external only works if both are set to True", + ) + if Apps.none in deploy: pass elif Apps.all in deploy and len(deploy) == 1: @@ -117,10 +126,7 @@ def new_pipeline( print("You cannot deploy 'all' but also specify specific apps at the same time") exit(1) else: - variables += [ - f"DEPLOY_{app.value.upper()}:'yes'" - for app in deploy - ] + variables += [f"DEPLOY_{app.value.upper()}:yes" for app in deploy] print(variables)