Skip to content

Commit

Permalink
added an example.
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrapCodes committed Jun 25, 2021
1 parent ea3a47f commit 0594c4e
Showing 1 changed file with 96 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: pr-loop-example
labels:
mylooplabels: mylooplabels
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: loop-task-inner
runAfter:
- echo-loop-task
params:
- name: message
value:
- I am the inner first one
- I am the inner second 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"

0 comments on commit 0594c4e

Please sign in to comment.