0

Is the on_fail directive of a step run when a previous step has failed ?

I'm using these steps :

- name: fail intentionally
  service: busybox
  command: false
- name: check if onfail is called
  service: busybox
  command: true
  on_fail:
    - command: echo reporting failure

Calling jet steps produces the following output :

(step: fail intentionally) 
(image: busybox) (service: busybox) Image exists, using cached image
(step: fail intentionally) error ✗
(step: fail intentionally) container exited with a 1 code

My on_fail is not run.

Is that an issue with the jet utility or would things behave the same in Codeship ?

olivieradam666
  • 4,522
  • 2
  • 20
  • 25

1 Answers1

0

You have defined an on_fail contingency for the second test step (a step that will not fail). If the on_fail was set for the first step (which fails and stops the build), you would have noted the echoed statement.

This behavior would be consistent with a build running in CodeShip Pro.

Drew Kitch
  • 201
  • 1
  • 3