`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
pipeline
keyword that acts likeinclude
in 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
pipeline
keyword 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.yml
when adding a new pipeline. In this way, we could have a convention of.gitlab/pipelines/*
to hold all your multiple pipelines. -
pipeline
should 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