An open API service indexing awesome lists of open source software.

https://github.com/andrewiankidd/multipass-gitlab-runner

Automatic configuration of a GitLab Runner via a reproducible Ubuntu VM
https://github.com/andrewiankidd/multipass-gitlab-runner

cd ci cicd devops gitlab

Last synced: about 21 hours ago
JSON representation

Automatic configuration of a GitLab Runner via a reproducible Ubuntu VM

Awesome Lists containing this project

README

          

## ๐Ÿ—๏ธ Multipass GitLab Runner

This project automates the provisioning of a GitLab Runner inside a lightweight Ubuntu VM using Multipass. It's fast, reproducible, and deployable with a single command.

---

## โœจ Features

- ๐Ÿ”„ One-command GitLab runner deployment with `start.sh`
- ๐Ÿ“ฆ Auto-provisioned runner using cloud-init
- ๐Ÿง Works on Windows, macOS, and Linux
- ๐Ÿท๏ธ Supports GitLab runner tags (e.g. `cypress`)
- ๐Ÿ” Easily rebuild, restart, or debug your runner VM

---

## โš™๏ธ Requirements

- Multipass (see install instructions below)
- A GitLab registration token
- Git Bash (for Windows users)

---

## ๐Ÿ’ป Installation

### ๐ŸชŸ Windows

1. Install Chocolatey:
```powershell
Set-ExecutionPolicy Bypass -Scope Process -Force; `
[System.Net.ServicePointManager]::SecurityProtocol = `
[System.Net.ServicePointManager]::SecurityProtocol -bor 3072; `
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
```

2. Install Multipass:
```powershell
choco install multipass
```

3. Run:
```bash
./start.sh
```

> ๐Ÿง  Use Git Bash for running scripts on Windows.

---

### ๐Ÿ macOS

1. Install Homebrew:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

2. Install Multipass:
```bash
brew install --cask multipass
```

3. Run:
```bash
./start.sh
```

---

### ๐Ÿง Linux

1. Install Snap:
```bash
sudo apt update
sudo apt install snapd
```

2. Install Multipass:
```bash
sudo snap install multipass
```

3. Run:
```bash
./start.sh
```

---

## ๐Ÿงพ Configuration

Copy and configure `.env` using the included example:

๐Ÿ“„ See [.env.example](./.env.example) for all options.

---

## ๐Ÿš€ Usage

Start or rebuild the VM:

```bash
./start.sh # spin up or resume
./rebuild.sh # destroy and recreate
```

Get a shell inside the VM:

```bash
multipass shell $VM_NAME
```

---

## ๐Ÿ”ง Use Cases

This repo is especially useful for jobs that need:

- ๐Ÿงช **Cypress E2E Testing**
- Use tag `cypress` in your GitLab CI job
- Offload Chrome/Electron tests to local VM

Other potential use cases:

- ๐Ÿณ Docker-based builds (Node, Python, Go, etc.)
- ๐Ÿงฌ Containerized integration tests
- ๐Ÿ“ธ Visual regression testing (e.g. Percy, Playwright)
- ๐Ÿ“ฆ Packaging or CI caching in self-contained environments

---

## โค๏ธ Contributions

Feel free to fork, extend, or open PRs โ€” this project welcomes improvements!