forked from kubeflow/kfp-tekton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloop-example-basic_taskspec.yaml
61 lines (61 loc) · 1.75 KB
/
loop-example-basic_taskspec.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
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: pr-loop-example
spec:
pipelineSpec:
tasks:
- name: first-task
taskSpec:
steps:
- name: echo
image: ubuntu
imagePullPolicy: IfNotPresent
script: |
#!/usr/bin/env bash
echo "I am the first task before the loop task"
- name: loop-task
runAfter:
- first-task
params:
- name: message
value:
- I am the first one
- I am the second one
- I am the third one
taskSpec:
apiVersion: custom.tekton.dev/v1alpha1
kind: PipelineLoop
spec:
iterateParam: message
pipelineSpec:
params:
- name: message
type: string
tasks:
- name: echo-loop-task
params:
- name: message
value: $(params.message)
taskSpec:
params:
- name: message
type: string
steps:
- name: echo
image: ubuntu
imagePullPolicy: IfNotPresent
script: |
#!/usr/bin/env bash
echo "$(params.message)"
- name: last-task
runAfter:
- loop-task
taskSpec:
steps:
- name: echo
image: ubuntu
imagePullPolicy: IfNotPresent
script: |
#!/usr/bin/env bash
echo "I am the last task after the loop task"