Register gitlab runner
https://docs.gitlab.com/runner/install/index.html https://docs.gitlab.com/runner/register/
Create and register gitlab runner
Now we need to create and register gitlab runner.
- In GitLab repository go to Settings -> CI / CD, on that page expand runners tab and scroll down to
Set up a specific Runner manually
:
Here we need a URL and registration token.
- Register a new gitlab runner with URL and registration token:
sudo gitlab-runner register --non-interactive --url "https://gitlab.faifly.com/" --registration-token "7aD7McHVi1eHgvcR5pgz" --description "Sample gitlab runner" --executor "docker" --docker-image "node-protractor:latest"
- Update
/etc/gitlab-runner/config.toml
, we need to addpull_policy = "if-not-present"
to prevent attempts to download docker image from the docker hub:
[[runners]]
name = "Sample gitlab runner"
url = "https://gitlab.faifly.com/"
token = "cdUkp293DkzHKbrBskBg"
executor = "docker"
[runners.docker]
tls_verify = false
image = "node-protractor:latest"
privileged = false
disable_cache = false
volumes = ["/cache"]
pull_policy = "if-not-present"
shm_size = 0
[runners.cache]
- Restart
gitlab-runner
:
sudo service gitlab-runner restart
Now the runner is registered: