The non-interactive way of registering a runner

In larger environments, deployments are frequently scripted. So, for the runner, there is also a non-interactive install available to help in the effort of automating the infrastructure. You can specify subcommands to the GitLab register argument. To find out about these options, type the following on the command line:

gitlab-runner register -h

To register a runner, using the most common options, you would do the following:

sudo gitlab-runner register 
--description "docker-runner"
--url "https://gitlab-ee.joustie.com/"
--registration-token "xxxx"
--executor "docker"
--docker-image alpine:latest
--non-interactive
--tag-list "docker,aws"
--run-untagged="true"
--locked="false"

When the runner is registered, it will show up in GitLab in the Runner list:

The registration process is basically the process of telling the runner where GitLab is situated, and initiating a key exchange to secure access to GitLab. Following a successful registration, the runner saves the configuration information in a TOML file, which looks as follows:

concurrent = 1
check_interval = 0

[[runners]]
name = "runnerhost.joustie.nl"
url = "https://gitlab-ee.joustie.nl"
token = "801bd1f41a3bb7a42c0b6f43e9ffc8"
executor = "shell"
shell = "bash"
[runners.cache]

The shell can also be set to sh for a simple Bourne shell or powershell on Windows. On Linux, this is usually placed in /etc/gitlab-runner/config.toml.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.175.182