Skip to content

Instantly share code, notes, and snippets.

@ahpook
Created March 24, 2020 06:57
Show Gist options
  • Save ahpook/996e503d4f0d7a6fe9f44461fd6e5047 to your computer and use it in GitHub Desktop.
Save ahpook/996e503d4f0d7a6fe9f44461fd6e5047 to your computer and use it in GitHub Desktop.
Conditional pipelinerun - Pipeline definition
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: conditional-pipeline
spec:
resources:
- name: source-repo
type: git
params:
- name: "path"
default: "README.md"
tasks:
- name: first-create-file
taskRef:
name: create-readme-file
resources:
outputs:
- name: workspace
resource: source-repo
- name: then-check
conditions:
- conditionRef: "file-exists"
params:
- name: "path"
value: "$(params.path)"
resources:
- name: workspace
resource: source-repo
from: [first-create-file]
taskRef:
name: echo-hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment