GitLab is of course an amazing piece of software. Continuous Integration (CI) or Continuous Deployment (CD) handling with GitLab Runner is even more fun to develop, build and deploy software.

I’m running a GitLab instance on a small local server within my private network. Also one instance of a GitLab Runner is running on the same machine. But sometimes I need some more small instances to run smaller tasks in parallel. This is a good job for one or more Raspberry Pis.

I have some prepared micro sd cards around. If needed just put it into some Raspberry Pis. Attach them to the network and make the building instances available. Each Raspberry is running docker. This is how to prepare the raspberry.

I am using a Raspberry Pi 3 B model running the latest Raspian Buster image (2019-09-26, download here: https://www.raspberrypi.org/downloads/raspbian/) without recommended software package.

First we are going to install Docker on raspian OS:

Install Docker

Install required packages

sudo apt install apt-transport-https ca-certificates software-properties-common -y

Download and install Docker package

curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh

Allow pi user to run docker commands

sudo usermod -aG docker pi

Add docker key

sudo curl https://download.docker.com/linux/raspbian/gpg

Open for editing the following file

sudo nano /etc/apt/sources.list

Add the following line

deb https://download.docker.com/linux/raspbian/ stretch stable

Update the entire pi

sudo apt update && sudo apt upgrade -y

Install the docker service

systemctl start docker.service

Reboot the system to check if docker starts up correct

sudo reboot

And finally check if the docker installation was successfully done by getting the docker info:

docker info

Next step is to install the gitlab runner software

Install GitLab Runner

Run GitLab package script

curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash

Install software package on raspberry pi:

sudo apt-get install gitlab-runner

Reboot the system

sudo reboot

After the reboot you should check the software status

sudo gitlab-runner status

If the software was installed successfully you should get a message like this:

gitlab-runner: Service is running!

The last step is to register your new GitLab Runner instance to your GitLab Server. Run the command and follow the instructions:

sudo gitlab-runner register

Hope this is helpful for you.

cheers,
Sebastian

2 thoughts on “ Install GitLab Runner on Raspberry Pi ”

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.