Is it possible to include remote files that include themselves other files?
I have 2 projects:
automation-templateshas all the defined pipelines and jobs
automation-templates ├── .gitlab-ci │ ├── jobs │ │ ├── check.yml # includes the child pipelines in dir "pipelines" │ │ ├── deploy.yml │ ├── pipelines │ │ ├── check.yml # includes the template jobs in dir "templates" │ │ ├── common.yml │ │ ├── deploy.yml │ ├── scripts │ │ ├── apply.sh │ │ ├── echo.sh │ ├── templates │ │ ├── check.yml # uses the scripts in dir "scripts" │ │ └── deploy.yml │ └── variables.yml ├── .gitlab-ci.yml
Sample content of the root
stages: - check - deploy workflow: rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH include: - ".gitlab-ci/variables.yml" - ".gitlab-ci/jobs/*.yml"
Sample content of the file
check: stage: check trigger: include: - local: "/.gitlab-ci/pipelines/check.yml" strategy: depend rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
my-appwhere I would like to use the pipeline declared in
automation-templates(see above) by having this following
include: - project: automation-templates ref: main file: .gitlab-ci.yml
This is working for the 1rst level of inclusion. Indeed I have my pipeline triggered in
my-app as the
my-app/.gitlab-ci.yml includes the remote
But it does work at the level of the included files
/.gitlab-ci/jobs/*.yml (on remote project
automation-templates because I got this error on
Found errors in your .gitlab-ci.yml: Local file `/.gitlab-ci/pipelines/check-talos.yml` does not exist!
I tried many configurations like indicated in the online documentation without success.
So I would like to know if such kind of use case should work in GitLab? This is a possible feature and I misconfigured something or it could be a bug in a “corner case”?
Thanks for your help.