Why can't gitlab-runner clone my project? (Incorrect host name, could not connect)

I am installing a Gitlab server and should run Windows tests using gitlab-runner.exe.

Artist gitlab-runner is set shell, config.tomllooks like

concurrent = 1
check_interval = 0

[[runners]]
  name = "PC123"
  url = "http://1.2.3.4/ci"
  token = "cd2b093adc5ca09ea41ee4eadb0752"
  executor = "shell"
  [runners.cache]

When a test spawns on commit, it fails with

Cloning into 'C:/git/builds/ac70aeb9/0/test/myproject'...
fatal: unable to access 'http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@localhost/test/boundaries.git/': Failed to connect to localhost port 80: Connection refused

I assume that the problem is the hostname "localhost" in the url that refers to the gitlab-runner machine. When I set up the server at the beginning, I used "localhost" as the server hostname. This was probably not a good idea. :)

In the meantime, I changed this "localgit", but the url is not configurable, it still shows "localhost". (Server restarted, restart gitlab-runner service).

, - , , localhost? .git/config IP:

[remote "origin"]
    url = http://1.2.3.4/test/myproject.git

( GitLab, http), gitlab-runner config.toml,

[runners.docker]
    extra_hosts = ["ci.mygitlab:127.0.0.1"]

shell, .

+4
1

, host: localhost Github /home/git/gitlab/config/gitlab.yml IP- .

:

  gitlab:
    ## Web server settings (note: host is the FQDN, do not include http://)
    host: localhost

:

  gitlab:
    ## Web server settings (note: host is the FQDN, do not include http://)
    host: 10.0.1.2
+1

Source: https://habr.com/ru/post/1690385/


All Articles