diff --git a/task/generate-odcs-compose/0.2/generate-odcs-compose.yaml b/task/generate-odcs-compose/0.2/generate-odcs-compose.yaml new file mode 100644 index 0000000000..2b8b13bd46 --- /dev/null +++ b/task/generate-odcs-compose/0.2/generate-odcs-compose.yaml @@ -0,0 +1,52 @@ +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + name: generate-odcs-compose +spec: + params: + - name: COMPOSE_INPUTS + description: relative path from workdir workspace to the compose inputs file + default: source/compose_inputs.yaml + - name: COMPOSE_OUTPUTS + description: relative path from workdir workspace to store compose output files + default: fetched.repos.d + workspaces: + - name: workdir + description: | + Working directory that will be used for reading configuration files + and writing the output + results: + - name: repodir_path + description: Directory to write the result .repo files. + steps: + - name: generate-odcs-compose + image: quay.io/redhat-appstudio/tools:39497ad4e7761c90fdde580cbb5bce9cb9491427 + env: + - name: CLIENT_ID + valueFrom: + secretKeyRef: + name: odcs-service-account + key: client-id + - name: CLIENT_SECRET + valueFrom: + secretKeyRef: + name: odcs-service-account + key: client-secret + - name: COMPOSE_INPUTS + value: "$(params.COMPOSE_INPUTS)" + - name: COMPOSE_OUTPUTS + value: "$(params.COMPOSE_OUTPUTS)" + script: | + #!/bin/bash + set -ex + + repodir_path="$(workspaces.workdir.path)/${COMPOSE_OUTPUTS}" + + cd "$(workspaces.workdir.path)" + + odcs_compose_generator \ + --compose-input-yaml-path "${COMPOSE_INPUTS}" \ + --compose-dir-path "${repodir_path}" + + echo "$repodir_path" > $(results.repodir_path.path)