How to use rule in gitlab to load configuration files

How Can I load configuration files based on rule

Hi all

Does anyone know if it’s possible to load the configuration YML file base rule in include?

Here is my example of the gitlab-ci.yml I really appreciate for any feedback


  - local: ".gitlab-ci.d/_common.gitlab-ci.yml"
  # load dev yml configuration files
  - local: '.gitlab-ci.d/${path}/*.yml'
      - if: '$path =~ /dev/'
  # load production yml configuration files
  - local: '.gitlab-ci.d/${path}/*.yml'
      - if: '$path =~ /prod/'     
  - project: "cloud-infra/version-map-"
    ref: dev
    file: "yamls/version-map.yaml"
  - project: 'Dev/utilities'
    ref: dev
    file: 'templates/stages.yaml'

in the above directory, several yml files are configured based on the environment.

some files to load in the above rule

Thanks for taking the time to be thorough in your request, it really helps! :blush: