Skip to content

Commit 04fe457

Browse files
committed
Freshen pipeline definition from latest defaults
There are some small functional changes: * Setting pipelinesascode.tekton.dev/cancel-in-progress: "true" for pre-merge, and "false" for post-merge. * Adding the image-digest param to the snyk task and removing the digest from the image-url param value. The other changes are not functionally consequential, but they make it easier to compare the existing yaml to the newly generated yaml. Useful vimdiff commands to review this change: vimdiff +'set ft=yaml' .tekton/cli-main-ci-pull-request.yaml <(git show release-v0.6:.tekton/cli-v06-pull-request.yaml|yq '.spec.pipelineSpec={}') vimdiff +'set ft=yaml' .tekton/cli-main-ci-push.yaml <(git show release-v0.6:.tekton/cli-v06-push.yaml|yq '.spec.pipelineSpec={}') vimdiff +'set ft=yaml' .tekton/cli-build.yaml <(git show release-v0.6:.tekton/cli-v06-pull-request.yaml|yq '{"spec":.spec.pipelineSpec}') Ref: https://issues.redhat.com/browse/EC-1135
1 parent ae653ef commit 04fe457

File tree

3 files changed

+29
-17
lines changed

3 files changed

+29
-17
lines changed

.tekton/cli-build.yaml

+19-11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ kind: Pipeline
33
metadata:
44
name: cli-build
55
spec:
6+
description: |
7+
This pipeline is ideal for building container images from a Containerfile while maintaining trust after pipeline customization.
8+
9+
_Uses `buildah` to create a container image leveraging [trusted artifacts](https://konflux-ci.dev/architecture/ADR/0036-trusted-artifacts.html). It also optionally creates a source image and runs some build-time tests. Information is shared between tasks using OCI artifacts instead of PVCs. EC will pass the [`trusted_task.trusted`](https://enterprisecontract.dev/docs/ec-policies/release_policy.html#trusted_task__trusted) policy as long as all data used to build the artifact is generated from trusted tasks.
10+
This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/repository/konflux-ci/tekton-catalog/pipeline-docker-build-oci-ta?tab=tags)_
611
finally:
712
- name: show-sbom
813
params:
@@ -156,7 +161,7 @@ spec:
156161
- name: ociArtifactExpiresAfter
157162
value: $(params.image-expires-after)
158163
- name: dev-package-managers
159-
value: 'true'
164+
value: "true"
160165
runAfter:
161166
- clone-repository
162167
taskRef:
@@ -363,8 +368,10 @@ spec:
363368
- "false"
364369
- name: sast-snyk-check
365370
params:
371+
- name: image-digest
372+
value: $(tasks.build-image-index.results.IMAGE_DIGEST)
366373
- name: image-url
367-
value: $(tasks.build-image-index.results.IMAGE_URL)@$(tasks.build-image-index.results.IMAGE_DIGEST)
374+
value: $(tasks.build-image-index.results.IMAGE_URL)
368375
- name: SOURCE_ARTIFACT
369376
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
370377
- name: CACHI2_ARTIFACT
@@ -446,10 +453,11 @@ spec:
446453
value: task
447454
resolver: bundles
448455
- name: rpms-signature-scan
449-
when:
450-
- input: $(params.skip-checks)
451-
operator: in
452-
values: ["false"]
456+
params:
457+
- name: image-url
458+
value: $(tasks.build-image-index.results.IMAGE_URL)
459+
- name: image-digest
460+
value: $(tasks.build-image-index.results.IMAGE_DIGEST)
453461
runAfter:
454462
- build-image-index
455463
taskRef:
@@ -461,11 +469,11 @@ spec:
461469
- name: kind
462470
value: task
463471
resolver: bundles
464-
params:
465-
- name: image-url
466-
value: $(tasks.build-image-index.results.IMAGE_URL)
467-
- name: image-digest
468-
value: $(tasks.build-image-index.results.IMAGE_DIGEST)
472+
when:
473+
- input: $(params.skip-checks)
474+
operator: in
475+
values:
476+
- "false"
469477
workspaces:
470478
- name: git-auth
471479
optional: true

.tekton/cli-main-ci-pull-request.yaml

+5-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ metadata:
66
build.appstudio.redhat.com/commit_sha: '{{revision}}'
77
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
88
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
9+
pipelinesascode.tekton.dev/cancel-in-progress: "true"
910
pipelinesascode.tekton.dev/max-keep-runs: "3"
10-
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "main"
11+
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
12+
== "main"
1113
pipelinesascode.tekton.dev/pipeline: ".tekton/cli-build.yaml"
1214
creationTimestamp: null
1315
labels:
@@ -26,10 +28,10 @@ spec:
2628
value: quay.io/redhat-user-workloads/rhtap-contract-tenant/ec-main-ci/cli-main-ci:on-pr-{{revision}}
2729
- name: bundle-cli-ref-repo
2830
value: quay.io/redhat-user-workloads/rhtap-contract-tenant/ec-main-ci/cli-main-ci
29-
- name: image-expires-after
30-
value: 5d
3131
- name: dockerfile
3232
value: Dockerfile.dist
33+
- name: image-expires-after
34+
value: 5d
3335
- name: path-context
3436
value: .
3537
- name: prefetch-input

.tekton/cli-main-ci-push.yaml

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ metadata:
55
build.appstudio.openshift.io/repo: https://github.com/enterprise-contract/ec-cli?rev={{revision}}
66
build.appstudio.redhat.com/commit_sha: '{{revision}}'
77
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
8+
pipelinesascode.tekton.dev/cancel-in-progress: "false"
89
pipelinesascode.tekton.dev/max-keep-runs: "3"
9-
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch == "main"
10+
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
11+
== "main"
1012
pipelinesascode.tekton.dev/pipeline: ".tekton/cli-build.yaml"
1113
creationTimestamp: null
1214
labels:
@@ -25,10 +27,10 @@ spec:
2527
value: quay.io/redhat-user-workloads/rhtap-contract-tenant/ec-main-ci/cli-main-ci:{{revision}}
2628
- name: bundle-cli-ref-repo
2729
value: quay.io/enterprise-contract/cli
28-
- name: image-expires-after
29-
value: ''
3030
- name: dockerfile
3131
value: Dockerfile.dist
32+
- name: image-expires-after
33+
value: ''
3234
- name: path-context
3335
value: .
3436
- name: prefetch-input

0 commit comments

Comments
 (0)