-
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.
Add params section to Pipelinerun doc
Adds params section to Pipelinerun doc to explain how to specify params in a Pipelinerun Spec Add examples in `examples/v1alpha1/pipelineruns` and `examples/v1beta1/pipelineruns` Fixes #2153 Signed-off-by: Nikhil Thomas <nikthoma@redhat.com>
- Loading branch information
1 parent
f1e3801
commit 8f427a8
Showing
3 changed files
with
202 additions
and
1 deletion.
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
92 changes: 92 additions & 0 deletions
92
examples/v1alpha1/pipelineruns/pipelinerun-with-params.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,92 @@ | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: Pipeline | ||
metadata: | ||
name: pipeline-with-params | ||
spec: | ||
params: | ||
- name: pl-param-x | ||
type: string | ||
default: "1" | ||
- name: pl-param-y | ||
type: string | ||
default: "1" | ||
tasks: | ||
- name: sum-params | ||
taskRef: | ||
name: sum-params | ||
params: | ||
- name: a | ||
value: "$(params.pl-param-x)" | ||
- name: b | ||
value: "$(params.pl-param-y)" | ||
- name: multiply-params | ||
taskRef: | ||
name: multiply-params | ||
params: | ||
- name: a | ||
value: "$(params.pl-param-x)" | ||
- name: b | ||
value: "$(params.pl-param-y)" | ||
--- | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: Task | ||
metadata: | ||
name: sum-params | ||
annotations: | ||
description: | | ||
A simple task that sums the two provided integers | ||
spec: | ||
inputs: | ||
params: | ||
- name: a | ||
type: string | ||
default: "1" | ||
description: The first integer | ||
- name: b | ||
type: string | ||
default: "1" | ||
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/v1alpha1 | ||
kind: Task | ||
metadata: | ||
name: multiply-params | ||
annotations: | ||
description: | | ||
A simple task that multiplies the two provided integers | ||
spec: | ||
inputs: | ||
params: | ||
- name: a | ||
type: string | ||
default: "1" | ||
description: The first integer | ||
- name: b | ||
type: string | ||
default: "1" | ||
description: The second integer | ||
steps: | ||
- name: product | ||
image: bash:latest | ||
script: | | ||
#!/usr/bin/env bash | ||
echo -n $(( "$(inputs.params.a)" * "$(inputs.params.b)" )) | ||
--- | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: PipelineRun | ||
metadata: | ||
name: pipelinerun-with-params | ||
spec: | ||
params: | ||
- name: pl-param-x | ||
value: "100" | ||
- name: pl-param-y | ||
value: "500" | ||
pipelineRef: | ||
name: pipeline-with-params |
90 changes: 90 additions & 0 deletions
90
examples/v1beta1/pipelineruns/pipelinerun-with-params.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,90 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Pipeline | ||
metadata: | ||
name: pipeline-with-params | ||
spec: | ||
params: | ||
- name: pl-param-x | ||
type: string | ||
default: "1" | ||
- name: pl-param-y | ||
type: string | ||
default: "1" | ||
tasks: | ||
- name: sum-params | ||
taskRef: | ||
name: sum-params | ||
params: | ||
- name: a | ||
value: "$(params.pl-param-x)" | ||
- name: b | ||
value: "$(params.pl-param-y)" | ||
- name: multiply-params | ||
taskRef: | ||
name: multiply-params | ||
params: | ||
- name: a | ||
value: "$(params.pl-param-x)" | ||
- name: b | ||
value: "$(params.pl-param-y)" | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: sum-params | ||
annotations: | ||
description: | | ||
A simple task that sums the two provided integers | ||
spec: | ||
params: | ||
- name: a | ||
type: string | ||
default: "1" | ||
description: The first integer | ||
- name: b | ||
type: string | ||
default: "1" | ||
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: Task | ||
metadata: | ||
name: multiply-params | ||
annotations: | ||
description: | | ||
A simple task that multiplies the two provided integers | ||
spec: | ||
params: | ||
- name: a | ||
type: string | ||
default: "1" | ||
description: The first integer | ||
- name: b | ||
type: string | ||
default: "1" | ||
description: The second integer | ||
steps: | ||
- name: product | ||
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-params | ||
spec: | ||
params: | ||
- name: pl-param-x | ||
value: "100" | ||
- name: pl-param-y | ||
value: "500" | ||
pipelineRef: | ||
name: pipeline-with-params |