-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
access execution status of pipelineTask
Introducing a variable which can be used to access the execution status of any pipelineTask in a pipeline. Use $(context.pipelineRun.Tasks.<pipelineTask>) as param value which contains the status, one of, Succeeded, Failed, TaskRunCancelled, and Unknown.
- Loading branch information
1 parent
da7a789
commit ebdb86d
Showing
10 changed files
with
327 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
examples/v1beta1/pipelineruns/pipelinerun-task-execution-status.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
kind: PipelineRun | ||
apiVersion: tekton.dev/v1beta1 | ||
metadata: | ||
generateName: pr-execution-status- | ||
spec: | ||
serviceAccountName: 'default' | ||
pipelineSpec: | ||
tasks: | ||
- name: task1 # successful task | ||
params: | ||
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 | ||
- name: task3 # failed task | ||
taskSpec: | ||
steps: | ||
- image: ubuntu | ||
name: fail | ||
script: | | ||
exit 1 | ||
finally: | ||
- name: task4 | ||
params: | ||
- name: pipelineRun-pipelineTask-task1 | ||
value: "$(context.pipelineRun.Tasks.task1)" | ||
- name: pipelineRun-pipelineTask-task2 | ||
value: "$(context.pipelineRun.Tasks.task2)" | ||
- name: pipelineRun-pipelineTask-task3 | ||
value: "$(context.pipelineRun.Tasks.task3)" | ||
taskSpec: | ||
params: | ||
- name: pipelineRun-pipelineTask-task1 | ||
- name: pipelineRun-pipelineTask-task2 | ||
- name: pipelineRun-pipelineTask-task3 | ||
steps: | ||
- image: ubuntu | ||
name: print-failed-task-status | ||
script: | | ||
echo "Pipeline Task Status: Task1: $(params.pipelineRun-pipelineTask-task1)" | ||
echo "Pipeline Task Status: Task2: $(params.pipelineRun-pipelineTask-task2)" | ||
echo "Pipeline Task Status: Task3: $(params.pipelineRun-pipelineTask-task3)" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.