Allow a list of files in CI include:file syntax
Problem to solve
GitLab 11.7 introduced the
include:file syntax for including a file from another project in CI configurations. It currently accepts a single file. In my GitLab instance, I have a GitLab project that holds a collection of CI configurations for all projects, and it is common for projects to include multiple files.
include:file syntax only allows a single file to be included. It would be useful if it allowed multiple multiple files to be specified.
- Sasha, Software Developer, https://design.gitlab.com/research/personas#persona-sasha
- Devon, DevOps Engineer, https://design.gitlab.com/research/personas#persona-devon
Here is an example of two files being included from one common project and ref.
include: - project: devops/ci-cd/pipelines ref: latest file: terraform/terraform.yml - project: devops/ci-cd/pipelines ref: latest file: terraform/deploy/continuous.yml
The include:file syntax should accept a list of files. That way, the project and ref don't have to be repeated, reducing the likelihood of errors and making changes easier.
include: - project: devops/ci-cd/pipelines ref: latest file: - terraform/terraform.yml - terraform/deploy/continuous.yml
What does success look like, and how can we measure that?
When a GitLab project includes multiple CI files from a common source project and ref, the local
.gitlab-ci.yml file should be DRY by not repeating the project and ref for every single file.