GitLab Runner
Install runners
Download binary for x86-64
sudo curl -L --output /usr/local/bin/gitlab-runner "https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64"
Change permission to execute
sudo chmod +x /usr/local/bin/gitlab-runner
Create GitLab CI user
sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash
Install and start service
sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
sudo gitlab-runner start
Registering runners
Obtaining a token
- For a shared runner, have an administrator go to the GitLab Admin Area and click Overview > Runners
- For a group runner, go to Settings > CI/CD and expand the Runners section
- For a project-specific runner, go to Settings > CI/CD and expand the Runners section
Register runner
- Run the following command:
sudo gitlab-runner register
- Enter your GitLab instance URL (also known as the
gitlab-ci coordinator URL
).
- Enter the token you obtained to register the runner.
- Enter a description for the runner. You can change this value later in the GitLab user interface.
- Enter the tags associated with the runner, separated by commas. You can change this value later in the GitLab user interface.
- Enter any optional maintenance note for the runner.
- Provide the runner executor. For most use cases, enter
docker
.
- If you entered
docker
as your executor, you are asked for the default image to be used for projects that do not define one in .gitlab-ci.yml
.