-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
pipelinerun-with-matrix.yaml
132 lines (132 loc) · 3.42 KB
/
pipelinerun-with-matrix.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: platform-browsers
annotations:
description: |
A task that does something cool with platforms and browsers
spec:
params:
- name: platform
- name: browser
steps:
- name: echo
image: mirror.gcr.io/alpine
script: |
echo "$(params.platform) and $(params.browser)"
---
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
generateName: matrixed-pr-
spec:
taskRunTemplate:
serviceAccountName: "default"
pipelineSpec:
tasks:
- name: platforms-and-browsers
displayName: "Platform: $(params.platform) with Browser: $(params.browser)"
matrix:
params:
- name: platform
value:
- linux
- mac
- windows
- name: browser
value:
- chrome
- safari
- firefox
taskRef:
name: platform-browsers
- name: matrix-and-params
matrix:
params:
- name: platform
value:
- linux
- mac
- windows
params:
- name: browser
value: chrome
taskRef:
name: platform-browsers
- name: matrix-and-params-include
matrix:
include:
- name: "Platform: $(params.platform) with Browser: $(params.browser)"
params:
- name: platform
value: linux
params:
- name: browser
value: chrome
taskRef:
name: platform-browsers
- name: matrix-params-with-empty-array-skipped
matrix:
params:
- name: version
value: []
taskSpec:
params:
- name: version
steps:
- name: echo
image: mirror.gcr.io/ubuntu
script: exit 1
- name: matrix-with-task-using-onerror
matrix:
params:
- name: version
value:
- "1"
- "2"
taskSpec:
params:
- name: version
steps:
- name: echo
image: mirror.gcr.io/ubuntu
onError: continue
script: exit 1
- name: matrix-with-task-retries
retries: 1
params:
- name: pipelineTask-retries
value: $(context.pipelineTask.retries)
matrix:
params:
- name: version
value:
- "1"
- "2"
taskSpec:
params:
- name: version
- name: pipelineTask-retries
steps:
- image: mirror.gcr.io/alpine
script: |
#!/usr/bin/env sh
if [ "$(context.task.retry-count)" == "$(params.pipelineTask-retries)" ]; then
echo "This is the last retry."
exit 0;
fi
echo "The PipelineTask has retried $(context.task.retry-count) times."
exit 1
finally:
- name: matrix-params-with-empty-array-skipped-in-finally
matrix:
params:
- name: version
value: []
taskSpec:
params:
- name: version
steps:
- name: echo
image: mirror.gcr.io/ubuntu
script: exit 1