Gitlab Runner for Auto Devops
The Auto DevOps pipeline in GitLab is supposed to be magic! It just reads your mind and does whatever you wanted! At least that seems to be what the sales blurb says!
Over the next few posts I will investigate how we use it. It is pretty clever, but we do need to set a couple of things first.
Requirements
This assumes docker is installed and working on the machine that will be used for the runner. I used my Linux desktop for this exercise which has Docker already set up.
Set up
First set up the GitLab runner. It uses the Docker executor. I believe this requires access to run Docker so as root I gave it permission:
|
|
Now set up the runner. In GitLab there is a page where you set up a runner for
a project or a group. For a project it is under Settings->CI/CD->Runners
That page gives the GitLab instance URL and the registration
token to use in the setup.
|
|
The important things here are the docker executor, and the image.
Once this is done it is important to give the runner privileged access.
If this is not done, it will error when trying to connect the docker repository.
Edit /etc/gitlab-runner/config.toml
and find the runner that was
just set up. Change the line
|
|
to read
|
|
Then restart the runner using:
|
|
If this isn’t done, the following error will appear in the job output.
Now the runner is set up. In the next post I will investigate how we use it to build a container.