chore: Flush external, formatting, new cluster

This commit is contained in:
Philip Gaber 2025-07-16 12:35:00 +02:00
parent 3cc79d3bb5
commit 672281f5c6
No known key found for this signature in database
GPG Key ID: 8D49EBCA3F8B797C

View File

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