Codeship Pro on_fail accross step

167 Views Asked by At

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 ?

1

There are 1 best solutions below

0
On

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.