gitlab-runner exec ignores CI_CONFIG_PATH
Summary
When using gitlab-runner exec
, runner reads .gitlab-ci.yml
unconditionally, and there is no way to change this file location. One may think that it can be changed with CI_CONFIG_PATH environment variable, but it doesn't work.
Steps to reproduce
- Get any repo where gitlab-ci.yml placed not in its default location, like
git clone https://salsa.debian.org/debian/pidcat.git
- Try to exec
gitlab-runner exec docker build --env CI_CONFIG_PATH=debian/.gitlab-ci.yml
orCI_CONFIG_PATH=debian/.gitlab-ci.yml gitlab-runner exec docker build
Actual behavior
FATAL: open .gitlab-ci.yml: no such file or directory
Expected behavior
Runner opens $CI_CONFIG_PATH
and reads job description from it.
Use cases
The most relevant case for me is testing Docker images that should be used in GitLab CI, like in https://salsa.debian.org/eighthave/ci-image-git-buildpackage/blob/6e021bd3a84d7092b2f90b31c2c6845b221f6bd6/.gitlab-ci.yml#L53
Looks like somebody also suffering from this problem: https://stackoverflow.com/q/48950765
Used GitLab Runner version
gitlab-runner 11.0.0 (5396d320)