chore: Flush external, formatting, new cluster
This commit is contained in:
parent
3cc79d3bb5
commit
672281f5c6
22
od-cli.py
22
od-cli.py
@ -14,16 +14,17 @@ app = typer.Typer()
|
|||||||
gl = gitlab.Gitlab(
|
gl = gitlab.Gitlab(
|
||||||
url=os.environ.get("OD_GL_URL", ""), private_token=os.environ.get("OD_GL_TOKEN", "")
|
url=os.environ.get("OD_GL_URL", ""), private_token=os.environ.get("OD_GL_TOKEN", "")
|
||||||
)
|
)
|
||||||
MASTER_PASSWORD = os.environ.get(
|
MASTER_PASSWORD = os.environ.get("OD_MASTER_PASSWORD", "sovereign-workplace")
|
||||||
"OD_MASTER_PASSWORD", "sovereign-workplace"
|
|
||||||
)
|
|
||||||
USER = os.environ.get("OD_USER", "od-user")
|
USER = os.environ.get("OD_USER", "od-user")
|
||||||
GL_USER = os.environ.get("OD_GL_USER", "od-gl-user")
|
GL_USER = os.environ.get("OD_GL_USER", "od-gl-user")
|
||||||
GL_PROJECT = os.environ.get("OD_GL_PROJECT", "1317")
|
GL_PROJECT = os.environ.get("OD_GL_PROJECT", "1317")
|
||||||
|
|
||||||
|
|
||||||
class Clusters(StrEnum):
|
class Clusters(StrEnum):
|
||||||
qa = "qa"
|
qa = "qa"
|
||||||
run = "run"
|
run = "run"
|
||||||
|
b1_stackit_butterfly = "b1-stackit-butterfly"
|
||||||
|
|
||||||
|
|
||||||
class Apps(StrEnum):
|
class Apps(StrEnum):
|
||||||
all = "all"
|
all = "all"
|
||||||
@ -89,7 +90,8 @@ def new_pipeline(
|
|||||||
test: bool = False,
|
test: bool = False,
|
||||||
test_branch: str = "develop",
|
test_branch: str = "develop",
|
||||||
ee: bool = False,
|
ee: bool = False,
|
||||||
env_stop: bool = True,
|
env_stop: bool = False,
|
||||||
|
flush_external: bool = False,
|
||||||
debug: bool = True,
|
debug: bool = True,
|
||||||
default_accounts: bool = True,
|
default_accounts: bool = True,
|
||||||
deploy: Annotated[List[Apps], typer.Option(case_sensitive=False)] = [Apps.none],
|
deploy: Annotated[List[Apps], typer.Option(case_sensitive=False)] = [Apps.none],
|
||||||
@ -102,6 +104,7 @@ def new_pipeline(
|
|||||||
f"NAMESPACE:{namespace}",
|
f"NAMESPACE:{namespace}",
|
||||||
f"MASTER_PASSWORD_WEB_VAR:{MASTER_PASSWORD}",
|
f"MASTER_PASSWORD_WEB_VAR:{MASTER_PASSWORD}",
|
||||||
f"ENV_STOP_BEFORE:{_tf_to_yn(env_stop)}",
|
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"RUN_TESTS:{_tf_to_yn(test)}",
|
||||||
f"TESTS_BRANCH:{test_branch}",
|
f"TESTS_BRANCH:{test_branch}",
|
||||||
f"DEBUG_ENABLED:{_tf_to_yn(debug)}",
|
f"DEBUG_ENABLED:{_tf_to_yn(debug)}",
|
||||||
@ -109,6 +112,12 @@ def new_pipeline(
|
|||||||
f"OPENDESK_ENTERPRISE:{'true' if ee else 'false'}",
|
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:
|
if Apps.none in deploy:
|
||||||
pass
|
pass
|
||||||
elif Apps.all in deploy and len(deploy) == 1:
|
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")
|
print("You cannot deploy 'all' but also specify specific apps at the same time")
|
||||||
exit(1)
|
exit(1)
|
||||||
else:
|
else:
|
||||||
variables += [
|
variables += [f"DEPLOY_{app.value.upper()}:yes" for app in deploy]
|
||||||
f"DEPLOY_{app.value.upper()}:'yes'"
|
|
||||||
for app in deploy
|
|
||||||
]
|
|
||||||
|
|
||||||
print(variables)
|
print(variables)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user