Using task results in pipelines
In the previous chapter, you've seen how to use results inside tasks to share information across steps. You can also use the same results to share limited information across tasks.
For the last example in this chapter, you will rewrite the dice-roll
task to produce a result instead of echoing the result. This randomly generated number will then be picked up by the logger
task to be displayed:
- Start by creating a file named
dice-results.yaml
in which you will create the base of your new task nameddice-roll-result
:apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: dice-roll-result spec:
- Just like you did in the previous version of the
die-roll
task, add a parameter with a default value of"6"
:params: - name: sides description: Number of sides to the dice default: "6" type: string...