gitlab-runner exec docker fails to mount the repository so it can be cloned
Summary
Since upgrading to gitlab-runner 11.11.0 (from 11.10.0), gitlab-runner exec docker is not able to check out the repo that is being tested.
Steps to reproduce
- Install gitlab-runner 11.11.0
- Create an empty git repo
- Add and commit the below .gitlab-ci.yml to the project
- Run
gitlab-runner exec docker break-runner
.gitlab-ci.yml
image: ruby
stages:
- test
break-runner:
stage: test
script:
- echo "I worked"
Actual behavior
Runner will exit with "fatal: repository '[path to repo]' does not exist"
Note
Downgrading gitlab-runner to 11.10.0 or manually mounting the repo as a docker volume (via --docker-volumes) allows the step to run successfully.
Expected behavior
Runner executes break-runner step and "I worked" is output.
Relevant logs and/or screenshots
job log
$ gitlab-runner exec docker break-runner
Runtime platform arch=amd64 os=linux pid=21787 revision=6c154264 version=11.11.0
fatal: ambiguous argument 'HEAD~1': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Running with gitlab-runner 11.11.0 (6c154264)
Using Docker executor with image ruby ...
Pulling docker image ruby ...
Using docker image sha256:682cc2f5b3831d33dce0bff44afa0562497287aec759473b66e0589959d5cdb7 for ruby ...
Running on runner--project-0-concurrent-0 via machine...
DEPRECATION: this GitLab server doesn't support refspecs, gitlab-runner 12.0 will no longer work with this version of GitLab
Cloning repository...
fatal: repository '/tmp/dummy' does not exist
ERROR: Job failed: exit code 1
FATAL: exit code 1
The "fatal" git error above is related to this sample repo. It does not occur in "real" repo's with more history. Though the failure state is the same.
Environment description
Running locally on ArchLinux / amd64 machine, no config defined.
Used GitLab Runner version
Version: 11.11.0
Git revision: 6c154264
Git branch:
GO version: go1.12.5
Built: 2019-05-24T04:08:49+0000
OS/Arch: linux/amd64