How to auto-run a GitLab CI job when at least one of the jobs in the previous stage succeeds?

Viewed 936

Given two stages, with two jobs in the first, and one job in the second stage:

stages:
  - a
  - b

foo:
    stage: a
    when: manual

faa:
    stage: a
    when: manual

bar:
    stage: b
    when: i_dont_know

I'd like to run the second stage when at least one job in the previous stage succeeds.

The docs, however, only show the following options for when:

  • on_success - Execute job only when all jobs in earlier stages succeed, or are considered successful because they have allow_failure: true.
  • on_failure - Execute job only when at least one job in an earlier stage fails.
  • always - Execute job regardless of the status of jobs in earlier stages.

Is there some trick to achieve my goal?

0 Answers
Related