Skip to content

Commit f1bd084

Browse files
committed
Add step to make our tasks trusted
1 parent 16e75c0 commit f1bd084

File tree

1 file changed

+46
-10
lines changed

1 file changed

+46
-10
lines changed

.tekton/acs-konflux-tasks-push.yaml

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ spec:
2626
value: '{{source_url}}'
2727
- name: revision
2828
value: '{{revision}}'
29-
- name: output-image
30-
value: quay.io/rhacs-eng/konflux-tasks:rev-{{revision}}
29+
- name: output-image-repo
30+
value: quay.io/rhacs-eng/konflux-tasks
31+
- name: output-image-tag
32+
value: rev-{{revision}}
33+
- name: output-trust-data-repo
34+
value: quay.io/rhacs-eng/konflux-tasks-trust
3135
- name: rebuild
3236
value: "true"
3337
- name: build-source-image
@@ -50,8 +54,14 @@ spec:
5054
description: Revision of the Source Repository
5155
name: revision
5256
type: string
53-
- description: Fully Qualified Output Image
54-
name: output-image
57+
- description: Repository of the output image
58+
name: output-image-repo
59+
type: string
60+
- description: Unique tag of the output image
61+
name: output-image-tag
62+
type: string
63+
- description: Image repository where to update data about tasks trust
64+
name: output-trust-data-repo
5565
type: string
5666
- default: .
5767
description: Path to the source code of an application's component from where
@@ -111,7 +121,7 @@ spec:
111121
- name: slack-notification
112122
params:
113123
- name: message
114-
value: ':x: `{{event_type}}` pipeline for <https://console.redhat.com/application-pipeline/workspaces/rh-acs/applications/acs/pipelineruns/$(context.pipelineRun.name)|$(context.pipelineRun.name)> (`$(params.output-image)`, revision <$(params.git-url)/commit/$(params.revision)|$(params.revision)>) has failed.'
124+
value: ':x: `{{event_type}}` pipeline for <https://console.redhat.com/application-pipeline/workspaces/rh-acs/applications/acs/pipelineruns/$(context.pipelineRun.name)|$(context.pipelineRun.name)> (`$(params.output-image-repo)`, revision <$(params.git-url)/commit/$(params.revision)|$(params.revision)>) has failed.'
115125
- name: key-name
116126
value: 'acs-konflux-notifications'
117127
when:
@@ -148,7 +158,7 @@ spec:
148158
- name: init
149159
params:
150160
- name: image-url
151-
value: $(params.output-image)
161+
value: $(params.output-image-repo):$(params.output-image-tag)
152162
- name: rebuild
153163
value: $(params.rebuild)
154164
- name: skip-checks
@@ -170,7 +180,7 @@ spec:
170180
- name: revision
171181
value: $(params.revision)
172182
- name: ociStorage
173-
value: $(params.output-image).git
183+
value: $(params.output-image-repo):$(params.output-image-tag).git
174184
- name: ociArtifactExpiresAfter
175185
value: $(params.oci-artifact-expires-after)
176186
taskRef:
@@ -197,7 +207,7 @@ spec:
197207
- name: SOURCE_ARTIFACT
198208
value: $(tasks.clone-repository.results.SOURCE_ARTIFACT)
199209
- name: ociStorage
200-
value: $(params.output-image).prefetch
210+
value: $(params.output-image-repo):$(params.output-image-tag).prefetch
201211
- name: ociArtifactExpiresAfter
202212
value: $(params.oci-artifact-expires-after)
203213
taskRef:
@@ -218,7 +228,7 @@ spec:
218228
- name: build-container
219229
params:
220230
- name: IMAGE
221-
value: $(params.output-image)
231+
value: $(params.output-image-repo):$(params.output-image-tag)
222232
- name: CONTEXT
223233
value: $(params.path-context)
224234
- name: SOURCE_ARTIFACT
@@ -240,7 +250,7 @@ spec:
240250
- name: build-image-index
241251
params:
242252
- name: IMAGE
243-
value: $(params.output-image)
253+
value: $(params.output-image-repo):$(params.output-image-tag)
244254
- name: COMMIT_SHA
245255
value: $(tasks.clone-repository.results.commit)
246256
- name: IMAGE_EXPIRES_AFTER
@@ -516,3 +526,29 @@ spec:
516526
- input: $(params.skip-checks)
517527
operator: in
518528
values: [ "false" ]
529+
530+
- name: update-tasks-trust
531+
description: Updates the image which allows to trust built tasks in EC.
532+
params:
533+
- name: TASKS_IMAGE
534+
value: $(params.output-image-repo):$(tasks.get-floating-tag.results.FLOATING_TAG)@$(tasks.build-image-index.results.IMAGE_DIGEST)
535+
- name: OUTPUT_IMAGE
536+
value: $(params.output-trust-data-repo):$(tasks.get-floating-tag.results.FLOATING_TAG)
537+
taskSpec:
538+
params:
539+
- name: TASKS_IMAGE
540+
type: string
541+
- name: OUTPUT_IMAGE
542+
type: string
543+
steps:
544+
- name: update-tasks-trust
545+
image: quay.io/konflux-ci/appstudio-utils:latest@sha256:5c77fe44dfd9615b1ba854e27e4ae2583146599eb4021ca8bd4662d2ba3ffa14
546+
script: |
547+
#!/usr/bin/env bash
548+
set -euo pipefail
549+
550+
ec --debug track bundle --freshen \
551+
--bundle "$(params.TASKS_IMAGE)" \
552+
--input "oci:$(params.OUTPUT_IMAGE)" --replace
553+
554+
echo "Done"

0 commit comments

Comments
 (0)