From 05888da9d6c621a614224cfd674b97c58f08d5d0 Mon Sep 17 00:00:00 2001 From: sallyom Date: Mon, 7 Oct 2024 18:58:54 -0400 Subject: [PATCH] add taxonomy to sdg fixtures for final eval Signed-off-by: sallyom --- sdg/faked/components.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sdg/faked/components.py b/sdg/faked/components.py index 643f05f..6c2b373 100644 --- a/sdg/faked/components.py +++ b/sdg/faked/components.py @@ -7,14 +7,24 @@ from utils.consts import PYTHON_IMAGE -@dsl.component(base_image=PYTHON_IMAGE) +@dsl.container_component def git_clone_op( taxonomy: dsl.Output[dsl.Dataset], repo_branch: str, repo_pr: Optional[int], repo_url: Optional[str], ): - return + return dsl.ContainerSpec( + "registry.access.redhat.com/ubi9/toolbox", + ["/bin/sh", "-c"], + [ + f"git clone {repo_url} {taxonomy.path} && cd {taxonomy.path} && " + + f'if [ -n "{repo_branch}" ]; then ' + + f"git fetch origin {repo_branch} && git checkout {repo_branch}; " + + f'elif [ -n "{repo_pr}" ] && [ {repo_pr} -gt 0 ]; then ' + + f"git fetch origin pull/{repo_pr}/head:{repo_pr} && git checkout {repo_pr}; fi " + ], + ) @dsl.component(