forked from tektoncd/pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipelinerun-task-execution-status.yaml
58 lines (58 loc) · 1.61 KB
/
pipelinerun-task-execution-status.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
kind: PipelineRun
apiVersion: tekton.dev/v1beta1
metadata:
generateName: pr-execution-status-
spec:
serviceAccountName: 'default'
pipelineSpec:
tasks:
- name: task1 # successful task
taskSpec:
steps:
- image: ubuntu
name: hello
script: |
echo "Hello World!"
- name: task2 # skipped task
when:
- input: "true"
operator: "notin"
values: ["true"]
taskSpec:
steps:
- image: ubuntu
name: success
script: |
exit 0
finally:
- name: task3 # this task verifies the status of dag tasks, it fails if verification fails
params:
- name: task1Status
value: "$(tasks.task1.status)"
- name: task2Status
value: "$(tasks.task2.status)"
taskSpec:
params:
- name: task1Status
- name: task2Status
steps:
- image: alpine
name: verify-dag-task-status
script: |
if [[ $(params.task1Status) != "Succeeded" || $(params.task2Status) != "None" ]]; then
exit 1;
fi
- name: task4 # this task verifies the aggregate status of all tasks, it fails if verification fails
params:
- name: aggregateStatus
value: "$(tasks.status)"
taskSpec:
params:
- name: aggregateStatus
steps:
- image: alpine
name: verify-aggregate-tasks-status
script: |
if [[ $(params.aggregateStatus) != "Completed" ]]; then
exit 1;
fi