-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathpipelinerun-with-matrix-and-results.yaml
69 lines (69 loc) · 2.03 KB
/
pipelinerun-with-matrix-and-results.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
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
- name: url
steps:
- name: echo
image: mirror.gcr.io/alpine
script: |
echo "Visit $(params.url) on $(params.platform) using $(params.browser)."
---
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
generateName: matrixed-pr-
spec:
taskRunTemplate:
serviceAccountName: "default"
pipelineSpec:
tasks:
- name: get-platforms
taskSpec:
results:
- name: platforms
type: array
steps:
- name: produce-a-list-of-platforms
image: mirror.gcr.io/bash
script: |
#!/usr/bin/env bash
echo -n "[\"linux\",\"mac\",\"windows\"]" | tee $(results.platforms.path)
- name: get-browsers-and-url
taskSpec:
results:
- name: browsers
type: array
- name: url
steps:
- name: produce-a-list-of-browsers
image: mirror.gcr.io/bash
script: |
#!/usr/bin/env bash
echo -n "[\"chrome\",\"safari\",\"firefox\"]" | tee $(results.browsers.path)
- name: produce-url
image: mirror.gcr.io/bash
script: |
#!/usr/bin/env bash
echo -n "myfavoritesitedotcom" | tee $(results.url.path)
- name: platforms-and-browsers-dag
matrix:
params:
- name: platform
value: $(tasks.get-platforms.results.platforms[*])
- name: browser
value:
- $(tasks.get-browsers-and-url.results.browsers[0])
- $(tasks.get-browsers-and-url.results.browsers[2])
- name: url
value:
- $(tasks.get-browsers-and-url.results.url)
taskRef:
name: platform-browsers