Gitlab Runner on a Local Machine

It is possible to run Gitlab runner on a local machine, which builds the projects hosted on gitlab.

Steps:
1. You need to install Docker (verified on Mac with docker+Virtual machine setup)
2. docker run -d --name gitlab-runner --restart always   -v /var/run/docker.sock:/var/run/docker.sock   -v /Users/Shared/gitlab-runner/config:/etc/gitlab-runner   gitlab/gitlab-runner:alpine

3. 
 docker exec -it gitlab-runner gitlab-runner register
4. 
enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/)
5. 
enter the gitlab-ci token for this runner: Find your token from https://gitlab.com/cites-gestion/etoile-core/settings/ci_cd
6. 
enter the gitlab-ci tags for this runner (some tag)
7. W
hether to run untagged builds [true]
8. Whether to lock the Runner to current project (false)
9. 
Please enter the executor: (in my case it was docker)
10. 
 default Docker image (e.g. ruby:2.1)

Voila you have docker running on your machine.

Now go to 
https://gitlab.com/cites-gestion/etoile-core/settings/ci_cd
Verify that the new runner is listed on dedicated runner list.
(disable shared runners and trigger the build)




No comments: