Search code examples
gitlabgitlab-cigitlab-ci-runner

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?)


Solution

  • 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?