Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab Build Runner on Windows uses HTTP instead of SSH

I am new to Gitlab CI but have been reading on the topic for a while now.
I have to test-compile C#-Projects on my Gitlab after every commit and found out that I need to use a Windows Shell-Runner setup for CI to build my project correctly.

Unfortunately, my Gitlab setup only allows developers and machines to connect over SSH, not HTTP. But my Windows runner always tries to connect over http and fails the build.

How can I configure it properly?
I already tried to edit the config.toml associated with the runner, but there is no option to specify whether to use ssh or http.

like image 672
Flash1232 Avatar asked Apr 16 '16 12:04

Flash1232


People also ask

Does GitLab runner use SSH?

You can generate the SSH key from the machine that GitLab Runner is installed on, and use that key for all projects that are run on this machine.

Which executor does GitLab runner use?

GitLab Runner can use Docker to run jobs on user provided images. This is possible with the use of Docker executor. The Docker executor when used with GitLab CI, connects to Docker Engine and runs each build in a separate and isolated container using the predefined image that is set up in .


1 Answers

If your runner is accessible through ssh, try and register it with the gitlab-runner register command.
See "GitLab Continuous Integration " from Christian Stankowic:

# sudo gitlab-runner register
 Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/ci):
 http://gitlab.localdomain.loc/ci
 Please enter the gitlab-ci token for this runner:
 xxx
 Please enter the gitlab-ci description for this runner:
 [gitlab.localdomain.loc]:
 Please enter the gitlab-ci tags for this runner (comma separated):
 rpm764,generic
 INFO[0035] 7ab95543 Registering runner... succeeded
 Please enter the executor: ssh, shell, parallels, docker, docker-ssh:
 ssh
 Please enter the SSH server address (eg. my.server.com):
 gitlab.localdomain.loc
 Please enter the SSH server port (eg. 22):
 22
 Please enter the SSH user (eg. root):
 su-gitlab-ci
 Please enter the SSH password (eg. docker.io):
 myPassword
 Please enter path to SSH identity file (eg. /home/user/.ssh/id_rsa):
 /home/su-gitlab-ci/.ssh/id_rsa
 INFO[0143] Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!

That would help generate the config.toml file with the right content, including an ssh config.

like image 123
VonC Avatar answered Sep 20 '22 15:09

VonC