diff --git a/docs/modules/ROOT/pages/how-to-guides/configuring-builds/proc_customize_build_pipeline.adoc b/docs/modules/ROOT/pages/how-to-guides/configuring-builds/proc_customize_build_pipeline.adoc index 3398e27e..56e79159 100644 --- a/docs/modules/ROOT/pages/how-to-guides/configuring-builds/proc_customize_build_pipeline.adoc +++ b/docs/modules/ROOT/pages/how-to-guides/configuring-builds/proc_customize_build_pipeline.adoc @@ -41,27 +41,58 @@ Example task: + [source] -- -name: example-task - params: - - name: example-param - value: “Example” - runAfter: - - build-container #You can be more specific by choosing another task - taskRef: - params: - - name: name - value: example-task - - name: bundle - value: - - name: kind - value: task - resolver: bundles - when: - - input: $(params.skip-checks) #This references the pipeline parameters - operator: in - values: - - "false" + name: example-task + params: + - name: example-param + value: “Example” + runAfter: + - build-container #You can be more specific by choosing another task + taskRef: + params: + - name: name + value: example-task # metadata.name field of the Task + - name: bundle + value: quay.io/tekton-bundle-catalog/example-task-bundle:1.0 + # For more details on tekton bundles, refer https://tekton.dev/docs/pipelines/pipelines/#tekton-bundles + - name: kind + value: task + resolver: bundles + when: + - input: $(params.skip-checks) #This references the pipeline parameters + operator: in + values: + - "false" -- + ++ +An example of custom task added to the pipeline which sends slack notification when the pipelinerun fails: ++ +[source] +-- + name: slack-webhook-notification + params: + - name: message + value: PipelineRun $(context.pipelineRun.name) failed + - name: secret-name + value: my-secret # name of the secret in the your namespace which contains slack web-hook URL + - name: key-name + value: dev-team # key name of the secret + taskRef: + params: + - name: bundle + value: quay.io/redhat-appstudio-tekton-catalog/task-slack-webhook-notification:0.1 + - name: name + value: slack-webhook-notification + - name: kind + value: Task + resolver: bundles + when: + - input: $(tasks.status) + operator: in + values: ["Failed"] +-- +Note that in order for this task to work you need to create a secret in your namespace with at least one key where value is webhook URL for slack. + + NOTE: If you want to define a task directly in this file, rather than using `taskRef`, you can use `taskSpec`. Visit the documentation linked in the <> section.