CI_PROJECT_DIR is not respected when set in the gitlab-ci.yml
When setting the CI_PROJECT_DIR variable within a job, I expected to have my code checked out in that directory.
I'm basing my assumptions on this document: https://docs.gitlab.com/ce/ci/variables/README.html
My gitlab runner is configured as executor = "docker"
My .gitlab-ci.yml file contains the following:
stages:
- build
- package
- test
- deploy
build:linux:
image: golang:1.7.1
stage: build
variables:
CI_PROJECT_DIR: /go/src/$CI_PROJECT_PATH/
script:
- git submodule init
- git submodule update --recursive
- go build -v -x -o build/$CI_PROJECT_NAME
Upon inspecting the environment of the newly created container, I can see that the environment variable persists, but It simply will not affect where the code is checked out / cloned.
This presents a problem for me because the golang docker image sets the $GOPATH to /go/ and I do not wish to junk up my CI file with moves, copies, symlinks, etc.
It would be nice if I could, per job, set the CI_PROJECT_DIR to determine where the code actually gets checked out.