Last active
May 6, 2020 07:46
-
-
Save pt033302/3fbe0f111c2fd5a6b2ff00b19f96b823 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
apiVersion: tekton.dev/v1alpha1 | |
kind: Task | |
metadata: | |
name: task1 | |
spec: | |
steps: | |
- name: task-one-step-one | |
image: ubuntu | |
command: ["/bin/bash"] | |
args: ['-c', 'for i in {1..2}; do echo GONLOGGIN 1 && sleep 1; done;'] | |
--- | |
apiVersion: tekton.dev/v1alpha1 | |
kind: Task | |
metadata: | |
name: task2 | |
spec: | |
steps: | |
- name: task-two-step-one | |
image: ubuntu | |
command: ["/bin/bash"] | |
args: ['-c', 'sleep 30'] | |
- name: task-two-step-two | |
image: ubuntu | |
script: | | |
#!/usr/bin/env bash | |
set -euxo pipefail | |
echo "Hello I am random number generator!!" | |
r=$(( $RANDOM % 5 )); | |
echo $r | |
if [ $r -eq 0 ]; then | |
exit 0 | |
else | |
exit 1 | |
fi | |
--- | |
apiVersion: tekton.dev/v1alpha1 | |
kind: Pipeline | |
metadata: | |
name: working-logs-long | |
spec: | |
tasks: | |
- name: task1 | |
taskRef: | |
name: task1 | |
- name: task2 | |
retries: 4 | |
taskRef: | |
name: task2 | |
--- | |
apiVersion: tekton.dev/v1alpha1 | |
kind: PipelineRun | |
metadata: | |
name: sample-piperun | |
spec: | |
pipelineRef: | |
name: working-logs-long |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment