0

Short story

How to tell gitlab-runner to use this specific git installation, e.g. at /opt/gitlab/embedded/bin/git?

Context

I am using a gitlab-runner with shell executor to build docker images. However the pipeline already fails at the beginning with

fatal: git fetch-pack: expected shallow list fatal: The remote end hung up unexpectedly

This is clearly related to this question. There are also good solution metioned in this answer.

One of them is to install a newer version of git. The current git --version gives git version 1.8.3.1 which is the system default. On the same machine I have GitLab running which comes with a newer version of git.

Via gitlab-rake gitlab:env:info I find that a newer git (/opt/gitlab/embedded/bin/git) is already installed, /opt/gitlab/embedded/bin/git --version gives git version 2.32.0.

Attempts

I already tried adding

environment = ["PATH=/opt/gitlab/embedded/bin:$PATH"]

to the specific [[runner]] in my /etc/gitlab-runner/config.toml but this seems to overwrite PATH completely (the pipeline fails with some mkdir not found error).

2
  • You miss at least a $ at :PATH. Here, you totally wreck the path variable with a constant 'PATH' string. Commented Aug 25, 2021 at 9:18
  • @amanin Well spotted, I already corrected the typo. I still have the same issue with the correct :$PATH. Commented Aug 25, 2021 at 9:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.