Gitlab yml nested include

Is it possible for a template to include another template? It does not seem to be working for me.

For example:

.gitlab-ci.yml

include:
  - 'https://myrepo.com/template1.yml'

stages:
  - build

buildit:
  extends: .job1
  stage: build

template1.yml

include:
  - 'https://myrepo.com/template2.yml'

.job1:
  extends: .job2
  variables:
    JOB: 'job1'

template2.yml

.job2:
  script: do somthing

It looks like there is a current issue.

1 Like

From the docs: https://docs.gitlab.com/ee/ci/yaml/#include

Note: Recursive includes are not supported meaning your external files should not use the include keyword, as it will be ignored.

1 Like