From f722cfc53141e4e8b232f2f7e8ecf9974b1563f3 Mon Sep 17 00:00:00 2001 From: Joe Stuart Date: Wed, 27 Mar 2024 10:52:43 -0500 Subject: [PATCH 1/3] update to test builds --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 142b00d366..bd0ce674c6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # build-definitions - +# update This repository contains components that are installed or managed by the managed CI and Build Team. This includes default Pipelines and Tasks. You need to have bootstrapped a working appstudio configuration from (see `https://github.com/redhat-appstudio/infra-deployments`) for the dev of pipelines or new tasks. From 8fc8175a24667b317040153124e61f4e19a3f1eb Mon Sep 17 00:00:00 2001 From: Joe Stuart Date: Wed, 27 Mar 2024 12:50:31 -0500 Subject: [PATCH 2/3] build-acceptable-bundles.sh was not found Set the working dir to the workspace path to fix --- .tekton/push.yaml | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.tekton/push.yaml b/.tekton/push.yaml index eaeab8c126..3535a27c24 100644 --- a/.tekton/push.yaml +++ b/.tekton/push.yaml @@ -134,6 +134,7 @@ spec: steps: - name: build-bundles image: quay.io/redhat-appstudio/appstudio-utils:{{ revision }} + workingDir: $(workspaces.artifacts.path)/source env: - name: REVISION value: "$(params.revision)" diff --git a/README.md b/README.md index bd0ce674c6..142b00d366 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # build-definitions -# update + This repository contains components that are installed or managed by the managed CI and Build Team. This includes default Pipelines and Tasks. You need to have bootstrapped a working appstudio configuration from (see `https://github.com/redhat-appstudio/infra-deployments`) for the dev of pipelines or new tasks. From 0cd903ee007d53c34f729ce85d614d879f65dd82 Mon Sep 17 00:00:00 2001 From: Joe Stuart Date: Wed, 27 Mar 2024 12:57:01 -0500 Subject: [PATCH 3/3] test bundle script --- .tekton/pull-request.yaml | 40 +++++++++++++++++++++ .tekton/scripts/build-acceptable-bundles.sh | 22 ++++++------ 2 files changed, 52 insertions(+), 10 deletions(-) diff --git a/.tekton/pull-request.yaml b/.tekton/pull-request.yaml index c4358099ec..ab24628b3d 100644 --- a/.tekton/pull-request.yaml +++ b/.tekton/pull-request.yaml @@ -172,6 +172,46 @@ spec: secretName: redhat-appstudio-tekton-catalog-build-definitions-pull-secret workspaces: - name: source + - name: build-acceptable-bundles + runAfter: + - build-bundles + workspaces: + - name: artifacts + workspace: workspace + taskSpec: + workspaces: + - name: artifacts + description: Workspace containing arbitrary artifacts used during the task run. + volumes: + - name: quay-secret + secret: + secretName: redhat-appstudio-tekton-catalog-build-definitions-pull-secret + steps: + - name: build-bundles + image: quay.io/redhat-appstudio/appstudio-utils:{{ revision }} + workingDir: $(workspaces.artifacts.path)/source + env: + - name: REVISION + value: "$(params.revision)" + - name: GIT_URL + value: "$(params.git-url)" + # per https://kubernetes.io/docs/concepts/containers/images/#imagepullpolicy-defaulting + # the cluster will set imagePullPolicy to IfNotPresent + # also per direction from Ralph Bean, we want to use image digest based tags to use a cue to automation like dependabot or renovatebot to periodially submit pull requests that update the digest as new images are released. + script: |- + #!/usr/bin/env bash + + export BUNDLES=( + $(workspaces.artifacts.path)/source/task-bundle-list + $(workspaces.artifacts.path)/source/pipeline-bundle-list + ) + + .tekton/scripts/build-acceptable-bundles.sh + + volumeMounts: + - mountPath: /root/.docker/config.json + subPath: .dockerconfigjson + name: quay-secret - name: e2e-tests params: - name: e2e_test_namespace diff --git a/.tekton/scripts/build-acceptable-bundles.sh b/.tekton/scripts/build-acceptable-bundles.sh index e8538860f7..39d5b34729 100755 --- a/.tekton/scripts/build-acceptable-bundles.sh +++ b/.tekton/scripts/build-acceptable-bundles.sh @@ -43,13 +43,15 @@ fi BUNDLES_PARAM=($(cat ${BUNDLES[@]} | awk '{ print "--bundle=" $0 }')) PARAMS=("${TASK_PARAM[@]}" "${BUNDLES_PARAM[@]}") -ec track bundle --debug \ - --input "oci:${DATA_BUNDLE_REPO}:latest" \ - --output "oci:${DATA_BUNDLE_REPO}:${TAG}" \ - --timeout "15m0s" \ - --freshen \ - --prune \ - ${PARAMS[@]} - -# To facilitate usage in some contexts, tag the image with the floating "latest" tag. -skopeo copy "docker://${DATA_BUNDLE_REPO}:${TAG}" "docker://${DATA_BUNDLE_REPO}:latest" + +echo ${PARAMS[@]} +# ec track bundle --debug \ +# --input "oci:${DATA_BUNDLE_REPO}:latest" \ +# --output "oci:${DATA_BUNDLE_REPO}:${TAG}" \ +# --timeout "15m0s" \ +# --freshen \ +# --prune \ +# ${PARAMS[@]} + +# # To facilitate usage in some contexts, tag the image with the floating "latest" tag. +# skopeo copy "docker://${DATA_BUNDLE_REPO}:${TAG}" "docker://${DATA_BUNDLE_REPO}:latest"