'Gitlab CI: depend on all the jobs that extend certain configuration
I need to depend on many jobs that do similar things and extend from a single configuration. Right now I list them all manually, but is there a way to do it automatically?
.job-template:
artifacts:
# some artifacts
job1:
extends: .job-template
job2:
extends: .job-template
final_job:
script:
# work with all the artifacts from previous jobs
dependencies:
# everything that extends from .job-template
Solution 1:[1]
Did you try grouping those jobs in a stage and use this stage as requirement for final job ?
Solution 2:[2]
Right now I list them all manually, but is there a way to do it automatically?
That's pretty much what you have to do. There is no automatic way to declare dependencies: and there is no way to declare a dependency from the dependent job(s).
You can implicitly do this by ordering of stages: and the stage: for the respective jobs and omitting dependencies: (by default, jobs depend on all other jobs in previous stages).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Rémi F |
| Solution 2 | sytech |
