Skip to content

Recursive includes in .gitlab-ci.yml

I wonder if anyone else is running into this problem and how they have resolved the issue. I'm currently using the include statement in my .gitlab-ci.yml. Everything works as expected granted that I include a second yaml file into the main .gitlab-ci.yml with one include. However once I look to add a include to the second yml as well I'm unable to detect any jobs on the second yml file and I question whether this is working at all.

Currently I have a need for the level of abstraction which would be helpful to include a serious of yaml files "russian doll style" which prevent me to constantly updated multiple gitlab-ci.yml in multiple repos.

Description

The ultimate goal of this would be to have my main gitlab-ci.yml have the following

*** Last something.yml file ***

stages:

  • Build

Build stage: Build script:

  • Hello`

*** Intermediate build.yml file***

stages:

  • Build

include:

  • 'http....../something.yml' `

*** Main gitlab-ci.yml file ***

stages:

  • PreBuild
  • Build
  • PostBuild

include:

  • 'http....../build.yml' `
Edited by Jason Yavorsky