Skip to content

Commit

Permalink
add taxonomy to sdg fixtures for final eval
Browse files Browse the repository at this point in the history
Signed-off-by: sallyom <somalley@redhat.com>
  • Loading branch information
sallyom committed Oct 8, 2024
1 parent 3e85318 commit 05888da
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions sdg/faked/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 05888da

Please sign in to comment.