Examples

Alerting on Failure

The following will perform the alert task only if the unit task fails:

plan:
- get: foo
- task: unit
  file: foo/unit.yml
  on_failure:
    task: alert
    file: foo/alert.yml

1.7.1.9 on_failure step hook

Any step can have on_failure tacked onto it, whose value is a second step to execute only if the parent step fails.

on_failure: step

The step to execute when the parent step fails. If the attached step succeeds, the entire step is still failed.