Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,761
    • Issues 44,761
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,328
    • Merge requests 1,328
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #25921
Closed
Open
Issue created Dec 27, 2018 by harbottle@harbottle

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

Edited Apr 11, 2021 by Dov Hershkovitch
Assignee
Assign to
Time tracking