`include:project` does not change the working directory for loading nested includes
Hey @AdrianDC,
thank you for your great work. It's nice to see the activitiy in this project, e.g. adding features like the include:project
. The approach with the specific .local
configuration is a nice one to test this stuff locally.
In case of nested includes in combination with include:project
, I found a bug. Assume the following minimal example:
project1/.gitlab-ci.yml
include:
- project: templates/ci-templates
file:
- /deploy-templates.yml
# Configuration for gitlabci-local
# ------------------------------------------------------------------------
.local:
include:
'templates/ci-templates': '../ci-templates'
...
templates/ci-templates/deploy-templates.yml
include:
- local: common.yml
...
Running this on the server side, the file common.yml
is loaded from the project templates/ci-templates
. Running this with gitlabci-local on my local machine, common.yml
is searched in the directory of the .gitlab-ci.yml
file, i.e. project1/
.
The solution for this problem might be to add a working_directory
argument to the function __include(...)
inside the file gitlabci_local/parser/gitlab.py
and change this to the project_path
, if the include type is include:project
. I already have a minimal MR in the pipeline, but I'm unsure if I've looked at everything correctly. Hopefully, it's a bit helpful.
Thank you very much and best regards Andi