I have the following job structure:
JOB_A:
stage: versioning
only:
- main
JOB_B_MANUAL:
stage: versioning
needs:
- JOB_A
only:
- main
when: manual
allow_failure: true
JOB_C_MANUAL:
stage: versioning
needs:
- JOB_A
only:
- main
when: manual
allow_failure: true
JOB_D_MANUAL:
stage: versioning
needs:
- JOB_A
only:
- main
when: manual
allow_failure: true
JOB_E_MANUAL:
stage: versioning
needs:
- JOB_B
- JOB_C
- JOB_D
only:
- main
when: on_success
How can I set this up to be:
Thanks
According to the doc: https://docs.gitlab.com/ee/ci/yaml/#when
Possible inputs:
If I understood well what you want to do, this following use case is missing: on_at_least_one_success: Run the job only when at least one job in earlier stages succeed. This could be a nice feature to propose ;)
However, if you do not have any concerns to put the JOB_E in a separated pipeline, here maybe a solution for you, hope it could be your workaround:
Project: my-test/ops/job-dependency
stages:
- versioning
JOB_A:
stage: .pre
script:
- echo "JOB_A_MANUAL"
JOB_B_MANUAL:
stage: versioning
script:
- echo "do something"
needs:
- JOB_A
when: manual
JOB_B_MANUAL_TRIGGER:
stage: .post
trigger:
project: my-test/ops/job-dependency-child
needs:
- JOB_B_MANUAL
JOB_C_MANUAL:
stage: versioning
script:
- echo "do something"
needs:
- JOB_A
when: manual
JOB_C_MANUAL_TRIGGER:
stage: .post
trigger:
project: my-test/ops/job-dependency-child
needs:
- JOB_C_MANUAL
JOB_D_MANUAL:
stage: versioning
script:
- echo "do something"
needs:
- JOB_A
when: manual
JOB_D_MANUAL_TRIGGER:
stage: .post
trigger:
project: my-test/ops/job-dependency-child
needs:
- JOB_D_MANUAL
Project: my-test/ops/job-dependency-child
stages:
- post
JOB_E:
stage: post
script:
- echo "do something"