forrus
forrus (Forgejo + Cirrus CI) is a CI bridge from Forgejo to Cirrus CI.
It works by having a dummy GitHub repository as a placeholder and uses Cirrus CI API to start a build.
Getting started
Public Instance
A public instance is available for Codeberg. However, the uptime is not guaranteed and the API client is moderately rate-limited. It's highly recommended to set up your private instance of forrus by following the guide below.
Private Instance
1. Register a Codeberg / Forgejo OAuth application
Go to application setting page and register for an OAuth application, with the redirect URL set to https://<your-forrus-instance-url>/oauth/callback.
A config.yml.sample file is provided with all the necessary fields. Fill in all of them and rename to config.yml.
3. Create the sqlite database file
Run the following command to populate all the required schemas:
sqlite3 database.db < schema/db.sql
4. Start the application
To start the application, run:
# If your config.yml is in the same location as the forrus binary:
forrus
# If your config location is in a different place:
forrus --config=/path/to/config.yml
You may want to use something like systemd to automatically start the service on boot.
Development guide
The program relies heavily on generated code for the following purposes:
- Database struct and boilerplate code. Uses GORM
- GraphQL client code and struct. Uses Khan
When you modified the content in the schema/ folder, you need to generate the respective client code using GORM/Khan:
# for GraphQL related, ie, schema/*.graphql
make gen-gql
# for database related, ie, schema/db.sql
make gen-dal
A local database can be initialized using:
make gen-local-db
Acknowledgements
The concept of forrus is inspired by yojo and cirrus-run. Part of the code has been written by vibe-coding and manually reviewed by me.
License
AGPLv3, refer to LICENSE