Wait for manual stage finish and run dependent tasks

Hi, I created pipeline with 3 tasks:

  1. Test - always run
  2. Deploy - run manually
  3. After deploy - run after Deploy task is finished

I also created .gitlab-ci.yml for this using when and dependencies settings

  - test
  - deploy
  - after_deploy

  stage: test
  image: alpine
    - echo test
    - docker

  stage: deploy
  image: alpine
    - echo run
    - docker
  when: manual
  stage: after_deploy
  image: alpine
    - waiting_for_interaction
    - echo after
   - 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?

1 Like

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 :slight_smile:
“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.