Skip to content

Instantly share code, notes, and snippets.

@pritidesai
Last active June 5, 2020 04:48
Show Gist options
  • Save pritidesai/889749f0735def3504b0180b0931c86f to your computer and use it in GitHub Desktop.
Save pritidesai/889749f0735def3504b0180b0931c86f to your computer and use it in GitHub Desktop.
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: pipeline-with-missing-default-params
spec:
params:
- name: pl-param-x
type: string
- name: pl-param-y
type: string
default: "2"
tasks:
- name: add-params
taskRef:
name: add-params
params:
- name: a
value: "$(params.pl-param-x)"
- name: b
value: "$(params.pl-param-y)"
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: add-params
annotations:
description: |
A simple task that sums the two provided integers
spec:
params:
- name: a
type: string
description: The first integer
- name: b
type: string
description: The second integer
steps:
- name: sum
image: bash:latest
script: |
#!/usr/bin/env bash
echo -n $(( "$(inputs.params.a)" + "$(inputs.params.b)" ))
---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: pipelinerun-with-missing-default-params
spec:
params:
- name: pl-param-x
value: "100"
pipelineRef:
name: pipeline-with-missing-default-params
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment