Add possibility define on_failure and on_success after_script
UPDATE
With the introduction of CI_JOB_STATUS you can add to the after_script and if statement which checks the CI_JOB_STATUS
Hello.
Description
I especially want such thing for per-job basis. Main purpose do different things depemdent from job status. Like tag built docker image on success with latest, or clean also intermediate images, run containrs etc…
Proposal
Example:
before_script:
- global before script
job:
before_script:
- execute this instead of global before script
script:
- my command
after_script:
when: on_failure
- execute this after my script if it failed
after_script:
when: on_success
- execute this after my script if it success
Links / references
https://docs.gitlab.com/ce/ci/yaml/README.html#before_script-and-after_script
Edited by Dov Hershkovitch