Task 3: GitLab runner

Register the first GitLab runner

As we now have the base installed, we just need to deploy your GitLab-Runner and we are ready to deploy the first pipeline. 

Click on settings and CI/CD

Click on Expand

Disable “Enable shared runners” and leave the page open. The URL and registration token we will need later to copy and paste.

Go back to the Ubuntu server (SSH session) and type. We need to execute this command two times! Copy the highlighted output but change the token

Register Docker runner
				
					sudo gitlab-runner register
				
			
				
					ERRO[0000] Docker executor: prebuilt image helpers will be loaded from /var/lib/gitlab-runner.
Running in system-mode.

Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
http://198.18.134.28/
Please enter the gitlab-ci token for this runner:
GR1348941zyu1aKSJTwvnWv6RaS7A
Please enter the gitlab-ci description for this runner:
[ubuntu]:
Please enter the gitlab-ci tags for this runner (comma separated):
docker
Registering runner... succeeded                     runner=GR134894
Please enter the executor: kubernetes, parallels, shell, virtualbox, docker+machine, docker-ssh+machine, docker, docker-ssh, ssh:
docker
Please enter the default Docker image (e.g. ruby:2.1):
alpine:3.16.2
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!

				
			
Register Shell runner
				
					sudo gitlab-runner register
				
			
				
					ERRO[0000] Docker executor: prebuilt image helpers will be loaded from /var/lib/gitlab-runner.
Running in system-mode.

Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
http://198.18.134.28/
Please enter the gitlab-ci token for this runner:
GR1348941zyu1aKSJTwvnWv6RaS7A
Please enter the gitlab-ci description for this runner:
[ubuntu]:
Please enter the gitlab-ci tags for this runner (comma separated):
shell
Registering runner... succeeded                     runner=GR134894
Please enter the executor: parallels, shell, ssh, docker+machine, docker-ssh+machine, docker, docker-ssh, virtualbox, kubernetes:
shell
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!

				
			

Check on the GitLab UI, if something changed. Refresh the page and expand “Runners”. You should be able to the two registered runners. Check if the tag “docker” and “shell” is visible.

Great we have two runners now! We are close to creating the first pipeline!