forked from tektoncd/pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipelinerun-results.yaml
79 lines (79 loc) · 1.81 KB
/
pipelinerun-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
70
71
72
73
74
75
76
77
78
79
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: add-task
spec:
params:
- name: first
description: the first operand
- name: second
description: the second operand
results:
- name: sum
description: the sum of the first and second operand
steps:
- name: add
image: alpine
env:
- name: OP1
value: $(params.first)
- name: OP2
value: $(params.second)
command: ["/bin/sh", "-c"]
args:
- echo -n $((${OP1}+${OP2})) | tee $(results.sum.path);
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: sum-three-pipeline
spec:
params:
- name: first
description: the first operand
- name: second
description: the second operand
- name: third
description: the third operand
tasks:
- name: first-add
taskRef:
name: add-task
params:
- name: first
value: $(params.first)
- name: second
value: $(params.second)
- name: second-add
taskRef:
name: add-task
params:
- name: first
value: $(tasks.first-add.results.sum)
- name: second
value: $(params.third)
results:
- name: sum
description: the sum of all three operands
value: $(tasks.second-add.results.sum)
- name: partial-sum
description: the sum of first two operands
value: $(tasks.first-add.results.sum)
- name: all-sum
description: the sum of everything
value: $(tasks.second-add.results.sum)-$(tasks.first-add.results.sum)
---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: sum-three-pipeline-run
spec:
pipelineRef:
name: sum-three-pipeline
params:
- name: first
value: "2"
- name: second
value: "10"
- name: third
value: "10"