Skip to content

[CI] Stages after a manual stage should not be started automatically

Summary

If I create two jobs, each one in a different stage, the first one being set to when: manual and the second job let to default (wihch is on_success according to the documentation), this second job is started automatically for each commit and fail miserably because it needs the first one to be completed.

Steps to reproduce

Try a simple pipeline config like this one


stages:
  - build
  - deploy

build_example:
  stage: build
  script:
    - echo "done" > build.tar.gz
  artifacts:
    expire_in: 2h
    paths:
      - ./*.tar.gz
  when: manual

deploy_example:
  stage: deploy
  dependencies:
    - build_example
  script:
    - mv build.tar.gz deployed.tar.gz

Expected behavior

The deploy job should not run until the build job is successful, meaning run at least once and successful.

Actual behavior

The deploy job is run without the 1st job and failed for each commit

More one that

Some could argue that I can set all the job to manual but when you have a pipeline with 10 jobs, you expect to be able to triggering the pipeline once, not 10 times.