Skip to content

Commit 77d93fc

Browse files
author
Andrei Neagu
committed
added possibility to enable disable legacy-escape option
1 parent fe3e7bf commit 77d93fc

File tree

2 files changed

+24
-16
lines changed

2 files changed

+24
-16
lines changed

src/docker_publisher_osparc_services/cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
)
2424

2525

26-
async def run_command(config: Path) -> None:
26+
async def run_command(config: Path, legacy_escape: bool) -> None:
2727
cfg = ConfigModel.from_cfg_path(config)
2828
print(cfg)
2929

@@ -87,7 +87,7 @@ async def run_command(config: Path) -> None:
8787
)
8888

8989
build_commands = get_commands_build_base(
90-
repo_model.pre_docker_build_hooks
90+
repo_model.pre_docker_build_hooks, legacy_escape
9191
)
9292
validate_commands_list(build_commands, env_vars)
9393

@@ -124,9 +124,9 @@ async def run_command(config: Path) -> None:
124124
@click.command()
125125
@click.version_option(version=__version__)
126126
@click.argument("config", type=Path)
127-
def main(config: Path):
127+
def main(config: Path, legacy_escape: bool = False) -> None:
128128
"""Interface to be used in CI"""
129-
asyncio.get_event_loop().run_until_complete(run_command(config))
129+
asyncio.get_event_loop().run_until_complete(run_command(config, legacy_escape))
130130

131131

132132
if __name__ == "__main__":

src/docker_publisher_osparc_services/gitlab_ci_setup/commands.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,26 @@
1313
CommandList = List[str]
1414

1515

16-
def get_commands_build_base(pre_docker_build_hooks: list[str]) -> CommandList:
17-
return [
18-
"git clone ${SCCI_REPO} ${SCCI_CLONE_DIR}",
19-
"cd ${SCCI_CLONE_DIR}",
20-
DOCKER_LOGIN,
21-
"ooil legacy-escape",
22-
"ooil compose",
23-
*pre_docker_build_hooks,
24-
"docker compose build",
25-
"docker tag ${SCCI_IMAGE_NAME}:${SCCI_TAG} ${SCCI_TARGET_REGISTRY_ADDRESS}/${SCCI_TEST_IMAGE}:${SCCI_TAG}",
26-
"docker push ${SCCI_TARGET_REGISTRY_ADDRESS}/${SCCI_TEST_IMAGE}:${SCCI_TAG}",
27-
]
16+
def get_commands_build_base(
17+
pre_docker_build_hooks: list[str], legacy_escape: bool
18+
) -> CommandList:
19+
return (
20+
[
21+
"git clone ${SCCI_REPO} ${SCCI_CLONE_DIR}",
22+
"cd ${SCCI_CLONE_DIR}",
23+
DOCKER_LOGIN,
24+
]
25+
+ ["ooil legacy-escape"]
26+
if legacy_escape
27+
else []
28+
+ [
29+
"ooil compose",
30+
*pre_docker_build_hooks,
31+
"docker compose build",
32+
"docker tag ${SCCI_IMAGE_NAME}:${SCCI_TAG} ${SCCI_TARGET_REGISTRY_ADDRESS}/${SCCI_TEST_IMAGE}:${SCCI_TAG}",
33+
"docker push ${SCCI_TARGET_REGISTRY_ADDRESS}/${SCCI_TEST_IMAGE}:${SCCI_TAG}",
34+
]
35+
)
2836

2937

3038
def get_commands_test_base() -> CommandList:

0 commit comments

Comments
 (0)