Skip to content

Development Guide

Environment Setup

The easiest way to contribute to drassi is by using Docker.

Requirements

  • A Git hosting system such as Gitea or GitLab.

Setting Up Gitea Locally

Start a local Gitea instance using Docker Compose:

Terminal window
docker compose up -d gitea

What it does is it will spin up a Gitea instance using SQlite (for simplicity) and configure it with the following credentials:

  • Username: admin
  • Password: password

Once Gitea is running, access the web interface at http://localhost:3000 using:

  • Username: admin
  • Password: password

Create a new repository to use for testing.

Setting Up the Development Container

Start a drassi testing container with:

Terminal window
make dev-container

The dev-container target runs the following command:

Terminal window
dev-container:
docker run --pull=always --privileged --rm -it \
-v "${PWD}:${PWD}" \
-w "${PWD}" \
--network host \
ghcr.io/drassi-run/ubuntu:22.04

Registering the Gitea Runner

  1. Navigate to the Gitea repository and register a new runner.
  2. Copy the registration token.

Building and Running Gitea Runner

Build the runner:

Terminal window
go build -o bin/gitea-runner ./runner-gitea

Register the runner:

Terminal window
./bin/gitea-runner register

Start the runner:

Terminal window
./bin/gitea-runner launch --config-dir /tmp/runner-config --name drassi

Go ahead make some changes to the repo and you should see the runner pickup jobs now.