CI variable in builds_dir makes TLS file unavailable

Summary

I have a virtualised runner, and configured the builds_dir to mount a shared folder from the host Mac: "builds_dir = "/Volumes/SharedFolders/Xcode/$CI_RUNNER_ID/"

However my pipeline fails, as it can not locate the cert file.

fatal: unable to access 'https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@gitlab.com/EXAMPLE/EXAMPLEPROJECT.git/': SSL: can't load CA certificate file /Volumes/SharedFolders/Xcode/237157/EXAMPLE/EXAMPLEPROJECT.tmp/CI_SERVER_TLS_CA_FILE

I have checked the folder, and it put the file under this path:

/Volumes/SharedFolders/Xcode/EXAMPLE/EXAMPLEPROJECT.tmp/CI_SERVER_TLS_CA_FILE

As far as I can tell, it is because in the cmd.go file, it uses the FullProjectDir() which calls the ToSlash() method from shell_escape, which does not replace the runner id variable.

Expected behavior

The CA file should placed in the right folder. If I copy it manually, it works.

Relevant logs and/or screenshots

I have added CI_DEBUG_TRACE = true and from the logs, it is clear what it does:

  • eval 'export CI_PROJECT_DIR=$'''/Volumes/SharedFolders/Xcode/237157/EXAMPLE/EXAMPLEPROJECT''' export CI_SERVER=$'''yes''' mkdir -p "/Volumes/SharedFolders/Xcode/$CI_RUNNER_ID/EXAMPLE/EXAMPLEPROJECT.tmp"

...

export CI_SERVER_TLS_CA_FILE="/Volumes/SharedFolders/Xcode/$CI_RUNNER_ID/EXAMPLE/EXAMPLEPROJECT.tmp/CI_SERVER_TLS_CA_FILE"

Environment description

Running with gitlab-runner 10.4.0 (857480b6) Using Parallels 13.3.0 executor...

Used GitLab Runner version

Edited by 🤖 GitLab Bot 🤖