I have a series of commands that I'd like to run in case a job fails (rollback and Slack notification, for example). Right now I need to add a
when: on_fail
attribute to each command (which isn't great because this also prevents me from referring to orb commands). Here's what I need to do currently:
my-job:
steps:
- checkout
- run: something-that-might-fail
- run:
when: on_fail
command: some-cleanup-command
- run:
when: on_fail
command: some-other-cleanup-command
I would love if I could just do something like this:
my-job:
steps:
- checkout
- run: something-that-might-fail
- when:
condition: on_fail
steps:
- my-orb/cleanup
- other-orb/some-command
Is this currently possible via some alternative method?