-
Notifications
You must be signed in to change notification settings - Fork 121
/
Copy pathpipelinespec-with-run-condition.yaml
74 lines (73 loc) · 1.63 KB
/
pipelinespec-with-run-condition.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
apiVersion: custom.tekton.dev/v1alpha1
kind: PipelineLoop
metadata:
name: conditionloop
spec:
pipelineSpec:
params:
- name: message
type: string
tasks:
- name: task1
params:
- name: message
value: $(params.message)
taskSpec:
params:
- name: message
type: string
results:
- name: output
steps:
- name: main
image: ubuntu
imagePullPolicy: IfNotPresent
script: |
#!/usr/bin/env bash
printf "$(params.message)" > $(results.output.path)
- name: task-ok
runAfter:
- task1
when:
- input: "$(tasks.task1.results.output)"
operator: in
values: ["B"]
taskSpec:
steps:
- name: main
image: ubuntu
imagePullPolicy: IfNotPresent
script: |
#!/bin/sh
echo "job start to run..."
- name: task-fail
runAfter:
- task1
when:
- input: "$(tasks.task1.results.output)"
operator: in
values: ["A"]
taskSpec:
steps:
- name: main
image: ubuntu
imagePullPolicy: IfNotPresent
script: |
#!/bin/sh
echo "continue loop"
iterateParam: message
---
apiVersion: tekton.dev/v1beta1
kind: CustomRun
metadata:
name: simplepipelinelooprun
labels:
last-loop-task: "task-fail"
spec:
params:
- name: message
value: '["A", "B", "A"]'
customRef:
apiVersion: custom.tekton.dev/v1alpha1
kind: PipelineLoop
name: conditionloop