I also created .gitlab-ci.yml for this using when and dependencies settings
stages:
- test
- deploy
- after_deploy
test_task:
stage: test
image: alpine
script:
- echo test
tags:
- docker
waiting_for_interaction:
stage: deploy
image: alpine
script:
- echo run
tags:
- docker
when: manual
after_interaction:
stage: after_deploy
image: alpine
dependencies:
- waiting_for_interaction
script:
- echo after
tags:
- docker
Task Deploy run only when I press Play button, but unfortunately After deploy doesn’t wait for Deploy, and run after Test stage. Can You please tell me, what is wrong with my configuration?
Manual actions are non-blocking by default. If you want to make manual action blocking, it is necessary to add allow_failure: false to the job’s definition in .gitlab-ci.yml.
This thread helped me to understand why users were allowed to click “Run/Play” on a manual job that was subsequent in the dependency tree even if the previous jobs had not been started. (they were all manual).
There appears to be now way to rectify this in the manual dependency job workflows.
Thanks, dude, that was in my case also the essence
“allow_failure: false”!
A citation from the docs:
Additionally, if a manual job is defined as blocking by adding allow_failure: false , the next stages of the pipeline will not run until the manual job is triggered. This can be used as a way to have a defined list of users allowed to “approve” later pipeline stages by triggering the blocking manual job.