-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for when within matrix.include
Signed-off-by: chengjoey <[email protected]>
- Loading branch information
Showing
14 changed files
with
348 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
examples/v1/pipelineruns/beta/pipelinerun-with-matrix-when-include.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
apiVersion: tekton.dev/v1 | ||
kind: Task | ||
metadata: | ||
name: mytask | ||
annotations: | ||
description: | | ||
A task that does something cool with GOARCH and version | ||
spec: | ||
params: | ||
- name: IMAGE | ||
default: '' | ||
- name: PLATFORM | ||
default: '' | ||
steps: | ||
- name: echo | ||
image: mirror.gcr.io/alpine | ||
script: | | ||
echo image: $(params.IMAGE) and platform: $(params.PLATFORM) | ||
--- | ||
apiVersion: tekton.dev/v1 | ||
kind: PipelineRun | ||
metadata: | ||
generateName: matrixed-include-when-pr | ||
spec: | ||
taskRunTemplate: | ||
serviceAccountName: default | ||
params: | ||
- name: enabled-platforms | ||
value: | ||
- arm64 | ||
- amd64 | ||
- name: platform-amd64 | ||
value: linux/amd64 | ||
- name: platform-arm64 | ||
value: linux/arm64 | ||
- name: platform-ppc64le | ||
value: linux-m4.xl/ppc64le | ||
- name: platform-s390x | ||
value: linux/s390x | ||
- name: output-image | ||
value: my-image | ||
pipelineSpec: | ||
tasks: | ||
- name: build-containers-multi-platform | ||
matrix: | ||
include: | ||
- name: amd64 | ||
params: | ||
- name: IMAGE | ||
value: $(params.output-image)-amd64 | ||
- name: PLATFORM | ||
value: $(params.platform-amd64) | ||
when: | ||
- input: "amd64" | ||
operator: in | ||
values: | ||
- "$(params.enabled-platforms[*])" | ||
- name: arm64 | ||
params: | ||
- name: IMAGE | ||
value: $(params.output-image)-arm64 | ||
- name: PLATFORM | ||
value: $(params.platform-arm64) | ||
when: | ||
- input: "arm64" | ||
operator: in | ||
values: | ||
- "$(params.enabled-platforms[*])" | ||
- name: ppc64le | ||
params: | ||
- name: IMAGE | ||
value: $(params.output-image)-ppc64le | ||
- name: PLATFORM | ||
value: $(params.platform-ppc64le) | ||
when: | ||
- input: "ppc64le" | ||
operator: in | ||
values: | ||
- "$(params.enabled-platforms[*])" | ||
- name: s390x | ||
params: | ||
- name: IMAGE | ||
value: $(params.output-image)-s390x | ||
- name: PLATFORM | ||
value: $(params.platform-s390x) | ||
when: | ||
- input: "s390x" | ||
operator: in | ||
values: | ||
- "$(params.enabled-platforms[*])" | ||
taskRef: | ||
name: mytask |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.