Using when expressions with parameters
For this first example, you will build a guess-the-number type of game. When you start the pipeline, it will ask you for a number as a parameter. In the pipeline, a when
expression will be used to compare this parameter's value with a hardcoded number. If the number is a match, it will output a message saying that you guessed the number accurately. The logger
task that you built in Chapter 5, Jumping into Pipelines, will be used in this pipeline to output the messages. For convenience, here is the task definition:
apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: logger spec: params: - name: text type: string steps: - name: log image: registry.access.redhat.com/ubi8/ubi-minimal script: | DATE=$(date +%d/%m/%Y\ %T) echo [$DATE] - $(params...