Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
235 changes: 113 additions & 122 deletions .tekton/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,6 @@ spec:
_Uses `buildah` to create a multi-platform 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. This pipeline requires that the [multi platform controller](https://github.com/konflux-ci/multi-platform-controller) is deployed and configured on your Konflux instance. Information is shared between tasks using OCI artifacts instead of PVCs. EC will pass the [`trusted_task.trusted`](https://conforma.dev/docs/policy/packages/release_trusted_task.html#trusted_task__trusted) policy as long as all data used to build the artifact is generated from trusted tasks.
This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/repository/konflux-ci/tekton-catalog/pipeline-docker-build-multi-platform-oci-ta?tab=tags)_
params:
- default:
- linux/x86_64
- linux/arm64
- linux/ppc64le
- linux/s390x
description: List of platforms to build the container images on. The available set of values is determined by the configuration of the multi-platform-controller.
name: build-platforms
type: array
- default: --all-projects --org=3e1a4cca-ebfb-495f-b64c-3cc960d566b4 --exclude=test*,vendor,third_party
description: Append arguments to Snyk code command.
name: snyk-args
type: string
- default: "true"
description: Build a source image.
name: build-source-image
type: string
- default: "false"
description: 'Enable in-development package managers. WARNING: the behavior may change at any time without notice. Use at your own risk.'
name: prefetch-input-dev-package-managers
- default: []
description: Additional image tags
name: additional-tags
Expand All @@ -47,11 +28,13 @@ spec:
name: output-image
type: string
- default: .
description: Path to the source code of an application's component from where to build image.
description: Path to the source code of an application's component from where
to build image.
name: path-context
type: string
- default: Dockerfile
description: Path to the Dockerfile inside the context specified by parameter path-context
description: Path to the Dockerfile inside the context specified by parameter
path-context
name: dockerfile
type: string
- default: "false"
Expand All @@ -67,15 +50,21 @@ spec:
name: prefetch-input
type: string
- default: ""
description: Image tag expiration time, time values could be something like 1h, 2d, 3w for hours, days, and weeks, respectively.
description: Image tag expiration time, time values could be something like 1h,
2d, 3w for hours, days, and weeks, respectively.
name: image-expires-after
type: string
- default: "false"
description: Build a source image.
name: build-source-image
type: string
- default: "true"
description: Add built image into an OCI image index
name: build-image-index
type: string
- default: docker
description: The format for the resulting image's mediaType. Valid values are oci or docker.
description: The format for the resulting image's mediaType. Valid values are
oci or docker.
name: buildah-format
type: string
- default: "false"
Expand All @@ -85,7 +74,8 @@ spec:
description: Use the package registry proxy when prefetching dependencies
name: enable-package-registry-proxy
- default: .
description: Target directories in component's source code to scan with SAST tools. Multiple values should be separated with commas.
description: Target directories in component's source code to scan with SAST tools.
Multiple values should be separated with commas.
name: sast-target-dirs
type: string
- default: []
Expand All @@ -97,21 +87,32 @@ spec:
name: build-args-file
type: string
- default: "false"
description: Whether to enable privileged mode, should be used only with remote VMs
description: Whether to enable privileged mode, should be used only with remote
VMs
name: privileged-nested
type: string
- default: ""
description: Sets the image created time and the SOURCE_DATE_EPOCH build argument. On its own, it does not change file timestamps inside the layers (set rewrite-timestamp to "true" for that). Leave empty to keep the actual build time.
description: Sets the image created time and the SOURCE_DATE_EPOCH build argument.
On its own, it does not change file timestamps inside the layers (set rewrite-timestamp
to "true" for that). Leave empty to keep the actual build time.
name: source-date-epoch
type: string
- default: "false"
description: When "true", clamp file modification times in the image layers to at most source-date-epoch. Does nothing unless source-date-epoch is set.
description: When "true", clamp file modification times in the image layers to
at most source-date-epoch. Does nothing unless source-date-epoch is set.
name: rewrite-timestamp
type: string
- default: "false"
description: When "true", omit the build history (history timestamps, layer metadata, etc.) from the resulting image.
description: When "true", omit the build history (history timestamps, layer metadata,
etc.) from the resulting image.
name: omit-history
type: string
- default:
- linux/x86_64
description: List of platforms to build the container images on. The available
set of values is determined by the configuration of the multi-platform-controller.
name: build-platforms
type: array
results:
- description: ""
name: IMAGE_URL
Expand All @@ -126,94 +127,6 @@ spec:
name: CHAINS-GIT_COMMIT
value: $(tasks.clone-repository.results.commit)
tasks:
- matrix:
params:
- name: image-platform
value:
- $(params.build-platforms)
name: roxctl-scan
params:
- name: image-digest
value: $(tasks.build-image-index.results.IMAGE_DIGEST)
- name: image-url
value: $(tasks.build-image-index.results.IMAGE_URL)
runAfter:
- build-image-index
taskRef:
params:
- name: name
value: roxctl-scan
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-roxctl-scan:0.2@sha256:78e49dd18ed8e438d28cbd27e7d93f98b3dab35dd77df7930810b747c6033d6e
- name: kind
value: task
resolver: bundles
timeout: 20m
when:
- input: $(params.skip-checks)
operator: in
values:
- "false"
- name: sast-snyk-check
params:
- name: ARGS
value: $(params.snyk-args)
- name: image-digest
value: $(tasks.build-image-index.results.IMAGE_DIGEST)
- name: image-url
value: $(tasks.build-image-index.results.IMAGE_URL)
- name: TARGET_DIRS
value: $(params.sast-target-dirs)
- name: SOURCE_ARTIFACT
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
- name: CACHI2_ARTIFACT
value: $(tasks.prefetch-dependencies.results.PREFETCH_ARTIFACT)
runAfter:
- build-image-index
taskRef:
params:
- name: name
value: sast-snyk-check-oci-ta
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-sast-snyk-check-oci-ta:0.5.1@sha256:53443febc3a87ea6d4baacffc70d6f7dbdd1b4e69e0852337661097c73433519
- name: kind
value: task
resolver: bundles
when:
- input: $(params.skip-checks)
operator: in
values:
- "false"
- name: prefetch-dependencies
params:
- name: dev-package-managers
value: $(params.prefetch-input-dev-package-managers)
- name: input
value: $(params.prefetch-input)
- name: enable-package-registry-proxy
value: $(params.enable-package-registry-proxy)
- name: SOURCE_ARTIFACT
value: $(tasks.clone-repository.results.SOURCE_ARTIFACT)
- name: ociStorage
value: $(params.output-image).prefetch
- name: ociArtifactExpiresAfter
value: $(params.image-expires-after)
runAfter:
- clone-repository
taskRef:
params:
- name: name
value: prefetch-dependencies-oci-ta
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-prefetch-dependencies-oci-ta:0.11.0@sha256:3839c8468b08b3aab55f4cc92e645ad275012f8ef8235a504aca397121a9e7da
- name: kind
value: task
resolver: bundles
workspaces:
- name: git-basic-auth
workspace: git-auth
- name: netrc
workspace: netrc
- name: apply-tags
params:
- name: ADDITIONAL_TAGS
Expand Down Expand Up @@ -270,6 +183,34 @@ spec:
workspaces:
- name: basic-auth
workspace: git-auth
- name: prefetch-dependencies
params:
- name: input
value: $(params.prefetch-input)
- name: enable-package-registry-proxy
value: $(params.enable-package-registry-proxy)
- name: SOURCE_ARTIFACT
value: $(tasks.clone-repository.results.SOURCE_ARTIFACT)
- name: ociStorage
value: $(params.output-image).prefetch
- name: ociArtifactExpiresAfter
value: $(params.image-expires-after)
runAfter:
- clone-repository
taskRef:
params:
- name: name
value: prefetch-dependencies-oci-ta
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-prefetch-dependencies-oci-ta:0.11.0@sha256:3839c8468b08b3aab55f4cc92e645ad275012f8ef8235a504aca397121a9e7da
- name: kind
value: task
resolver: bundles
workspaces:
- name: git-basic-auth
workspace: git-auth
- name: netrc
workspace: netrc
- matrix:
params:
- name: PLATFORM
Expand All @@ -294,8 +235,6 @@ spec:
- name: BUILD_ARGS
value:
- $(params.build-args[*])
- name: BUILD_ARGS_FILE
value: $(params.build-args-file)
- name: PRIVILEGED_NESTED
value: $(params.privileged-nested)
- name: SOURCE_URL
Expand All @@ -316,6 +255,9 @@ spec:
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
- name: IMAGE_APPEND_PLATFORM
value: "true"
- name: BUILD_ARGS_FILES
value:
- $(params.build-args-file)
- name: PREFETCH_ARTIFACT
value: $(tasks.prefetch-dependencies.results.PREFETCH_ARTIFACT)
runAfter:
Expand Down Expand Up @@ -399,6 +341,33 @@ spec:
operator: in
values:
- "false"
- matrix:
params:
- name: image-platform
value:
- $(params.build-platforms)
name: roxctl-scan
params:
- name: image-digest
value: $(tasks.build-image-index.results.IMAGE_DIGEST)
- name: image-url
value: $(tasks.build-image-index.results.IMAGE_URL)
runAfter:
- build-image-index
taskRef:
params:
- name: name
value: roxctl-scan
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-roxctl-scan:0.2@sha256:78e49dd18ed8e438d28cbd27e7d93f98b3dab35dd77df7930810b747c6033d6e
- name: kind
value: task
resolver: bundles
when:
- input: $(params.skip-checks)
operator: in
values:
- "false"
- matrix:
params:
- name: platform
Expand All @@ -424,6 +393,32 @@ spec:
operator: in
values:
- "false"
- name: sast-snyk-check
params:
- name: image-digest
value: $(tasks.build-image-index.results.IMAGE_DIGEST)
- name: image-url
value: $(tasks.build-image-index.results.IMAGE_URL)
- name: TARGET_DIRS
value: $(params.sast-target-dirs)
- name: SOURCE_ARTIFACT
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
runAfter:
- build-image-index
taskRef:
params:
- name: name
value: sast-snyk-check-oci-ta
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-sast-snyk-check-oci-ta:0.5.1@sha256:53443febc3a87ea6d4baacffc70d6f7dbdd1b4e69e0852337661097c73433519
- name: kind
value: task
resolver: bundles
when:
- input: $(params.skip-checks)
operator: in
values:
- "false"
- matrix:
params:
- name: image-arch
Expand Down Expand Up @@ -461,8 +456,6 @@ spec:
value: $(params.sast-target-dirs)
- name: SOURCE_ARTIFACT
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
- name: CACHI2_ARTIFACT
value: $(tasks.prefetch-dependencies.results.PREFETCH_ARTIFACT)
runAfter:
- build-image-index
taskRef:
Expand All @@ -489,8 +482,6 @@ spec:
value: $(params.sast-target-dirs)
- name: SOURCE_ARTIFACT
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
- name: CACHI2_ARTIFACT
value: $(tasks.prefetch-dependencies.results.PREFETCH_ARTIFACT)
runAfter:
- build-image-index
taskRef:
Expand Down
4 changes: 2 additions & 2 deletions .tekton/kn-client-cli-artifacts-117-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ spec:
value: '{{source_url}}'
- name: hermetic
value: "true"
- name: build-source-image
value: "true"
- name: image-expires-after
value: 5d
- name: output-image
Expand All @@ -44,8 +46,6 @@ spec:
value: '{{revision}}'
- name: prefetch-input
value: '[{"type":"rpm"}]'
- name: prefetch-input-dev-package-managers
value: 'true'
taskRunSpecs:
- pipelineTaskName: sast-shell-check
stepSpecs:
Expand Down
10 changes: 8 additions & 2 deletions .tekton/kn-client-cli-artifacts-117-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,16 @@ spec:
value: '{{source_url}}'
- name: hermetic
value: "true"
- name: build-source-image
value: "true"
- name: output-image
value: quay.io/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-137/kn-client-cli-artifacts:{{revision}}
- name: build-platforms
value:
- linux/x86_64
- linux/arm64
- linux/ppc64le
- linux/s390x
- name: revision
value: '{{revision}}'
- name: additional-tags
Expand All @@ -43,8 +51,6 @@ spec:
- latest
- name: prefetch-input
value: '[{"type":"rpm"}]'
- name: prefetch-input-dev-package-managers
value: 'true'
taskRunSpecs:
- pipelineTaskName: sast-shell-check
stepSpecs:
Expand Down
Loading