Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure the address to fetch for repositories in gitlab runners?

I see that my runner is trying to clone the repository from localhost:8081.

The problem is that my repository is on the gitlab server which is not localhost:8081.

How do I tell my gitlab to tell to the runner that he has another address (like 10.29.39.29:43823?)

like image 821
gurghet Avatar asked Oct 17 '25 21:10

gurghet


2 Answers

GitLab should send the repo URL to the Runner, so if GitLab is sending localhost:8081 while it's really on 10.29.39.29:43823 then the GitLab instance is what's misconfigured, not the Runner.

According to the Documentation you can set the external URL by adding/editing etc/gitlab/gitlab.rb with external_url "http://gitlab.example.com", in your case external_url 10.29.39.29:43823. After that, run sudo gitlab-ctl reconfigure and the Runner should work.

If you're not using Omnibus (and you definitely should be, since this kind of thing is a decent bit more complicated), this won't work.

Assuming that doesn't work, are you hosting it yourself? What version of GitLab and GitLab Runner are you using?

like image 113
Connor Shea Avatar answered Oct 21 '25 08:10

Connor Shea


You may also change the runner's config.toml:

[[runners]]
  clone_url = "10.29.39.29:43823"

https://docs.gitlab.com/runner/configuration/advanced-configuration.html#how-clone_url-works

like image 38
Johannes Avatar answered Oct 21 '25 09:10

Johannes