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

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?

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.

https://docs.gitlab.com/ee/ci/yaml/#when-manual

1 Like

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.