Commit 85ed58f8 authored by Addshore's avatar Addshore 🏄
Browse files

Document CI setup!

parent 2dfb0f3c
# CI
Continious integration for this project is currently set up on a dedicated Cloud VPM machine.
Currently this CI will NOT work for forks of this project, only for actual project branches.
## Maintenance
If the runner starts running out of space...
sudo docker system prune --force
sudo docker volume prune
If this doesn't free up enough space the next step would be to nuke the registry cotnainer and volume and recreate it!
## Initial Setup
### Make a machine
Make a VM, such as ``
### Install docker
sudo apt-get remove docker docker-engine containerd runc
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli
### Install gitlab runner
curl -LJO ""
sudo dpkg -i gitlab-runner_amd64.deb
### Register the runner
sudo gitlab-runner register -n \
--url \
--registration-token XXXreleng-mwcli-tokenXXX \
--executor docker \
--limit 6 \
--name "gitlab-runner-addshore-1001-docker-0012" \
--docker-image "docker:19.03.12" \
--docker-privileged \
--docker-volumes "/certs/client"
### Extra configuration
#### Configure "global" runner jobs
Allow 6 jobs at once globally on this runner and restart gitlab runner
sudo sed -i 's/^concurrent =.*/concurrent = 6/' "/etc/gitlab-runner/config.toml"
sudo systemctl restart gitlab-runner
#### Register custom local docker mirror
Mainly from
Create a mirror (using docker):
sudo docker run -d -p 6000:5000 \
--restart always \
--name registry registry:2
Get the IP address:
hostname --ip-address
Add the mirror:
sudo echo '{"registry-mirrors": ["http://<CUSTOM IP>"]}' > /etc/docker/daemon.json
sudo service docker restart
Check with:
docker system info
Also add the mirror for dind in `/etc/gitlab-runner/config.toml` to each runner it is needed for
name = "docker:19.03.12-dind"
command = ["--registry-mirror", "https://<CUSTOM IP>"]
And restart the gitlab runner service:
sudo systemctl restart gitlab-runner
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment