I am new to Gitlab and Gitlab CI and I am reading the documentation for .gitlab-ci.yml files. I was looking through some of the examples and from my knowledge this yml seems to be cleaning up the build twice when the build fails. I would appreciate any help with explaining what this file is doing. Thank you in advance to all the help.
stages:
- build
- cleanup_build
- test
- deploy
- cleanup
build_job:
stage: build
script:
- make build
cleanup_build_job:
stage: cleanup_build
script:
- cleanup build when failed
when: on_failure
test_job:
stage: test
script:
- make test
deploy_job:
stage: deploy
script:
- make deploy
cleanup_job:
stage: cleanup
script:
- cleanup after builds
when: always