`pipeline` to include w/ local variables
Problem to solve
Include a sub-pipeline, where the sub-pipeline can be defined as a complete pipeline, including global variables that are shared between jobs in that pipeline, but which don't leak into other parts of the pipeline that are defined outside the file.
Target audience
Further details
This is particularly useful for letting people define multiple pipelines as if they are truly independent, but then include them into a single .gitlab-ci.yml file
Proposal
- Add
pipelinekeyword that acts likeincludein that it reads another file and incorporates it into the pipeline, but with different rules. - Any "global" keys in the sub-pipeline would be sub-pipeline-local. Liked scoped variables in programming languages.
- Optionally, let the
pipelinekeyword apply to a directory (or wildcard pattern?) to slurp up all the pipelines in that directory so you don't have to modify the.gitlab-ci.ymlwhen adding a new pipeline. In this way, we could have a convention of.gitlab/pipelines/*to hold all your multiple pipelines. -
pipelineshould also be able to point to external web URLs to consume shared pipelines, potentially written by third parties.
What does success look like, and how can we measure that?
Links / references
Edited by Mark Pundsack