`pipeline` to include w/ local variables
### Problem to solve <!--- What problem do we 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 <!--- For whom are we doing this? Include either a persona from https://design.gitlab.com/getting-started/personas or define a specific company role. e.a. "Release Manager" or "Security Analyst" --> ### Further details <!--- Include use cases, benefits, and/or goals (contributes to our vision?) --> 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 <!--- How are we going to solve the problem? --> 1. Add `pipeline` keyword that acts like `include` in that it reads another file and incorporates it into the pipeline, but with different rules. 1. Any "global" keys in the sub-pipeline would be sub-pipeline-local. Liked scoped variables in programming languages. 1. 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. 1. `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? <!--- If no way to measure success, link to an issue that will implement a way to measure this --> ### Links / references
issue