Support wildcards when specifying include paths in .gitlab-ci.yml
Release notes
Include keyword in CI/CD pipelines allows you to break down one long gitlab-ci.yml file into multiple files to increase readability, or reduce duplication of the same configuration in multiple places, in many cases there are multiple files to be included in a single CI/CD pipelines, in this release we now support the usage of a wildcard on the include file path which makes the CI/CD pipeline less verbose and easier to read.
Problem to solve
It would be really useful if the include
keyword in .gitlab-ci.yml
supported wildcards, e.g.:
include: '/libs/*/ci.yml'
Target audience
Developers / DevOps
Further details
The ability to "include" external files when writing the .gitlab-ci.yml
file is really great. However, I think it would be of even more use if wildcards could be used in (local?) include paths.
Consider the following example:
.build_libs:
stage: build
script:
- foo bar
include: '/libs/*/ci.yml'
When adding a new dir in libs
, devs can then simply drop in a ci.yml
file, extend .build_libs
and their new file will be automatically included without any edit to the main .gitlab-ci.yml
file.
Proposal
When parsing include paths, expand wildcards to build the final list of files to be included.
What does success look like, and how can we measure that?
New local include files, covered by wildcard paths, will be included without additional edits to the .gitlab-ci.yml
file.
Links / references
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.