simple, lightweight CI service for use with gitea
A wrapper around systemd-nspawn
and debootstrap
for running isolated tests.
Can be run for local builds, and also ships a web server for usage with gitea
.
A sample configuration file for testing bolt
[fling]
commands =
service postgresql start
su postgres -s /bin/sh -c 'psql -c "CREATE USER bolt PASSWORD '"'"'bolt'"'"' SUPERUSER" -d postgres'
su postgres -s /bin/sh -c 'psql -c "CREATE DATABASE bolt_test OWNER bolt" -d postgres'
export MIX_ENV=test
export PGSQL_TEST_URL=postgres://bolt:bolt@/bolt_test
mix local.hex --force
mix local.rebar --force
mix deps.get
mix deps.compile
mix compile
packages = ca-certificates,elixir,erlang,git,postgresql-11
The packages specified in packages
will be cached across invocations.commands
are simply run via shell.
Head to your project directory and execute python3 -m fling build
as root.
user/settings/applications
)fling
with the generated --gitea-token
, ensure it is reachable tohttp://<FLING_ADDR>/hook/gitea
Configure root to have SSH keys to clone repositories you want to use it on.
Then, see python3 -m fling server --help
for usage. Do not bind fling on a public IP
address.
Once the server is running, add a webhook on your repositories to test, pointing
to the address of the fling server, path /hook/gitea
.
When fling
receives a build via its webhook route /hook/gitea
, it performs
the following:
--trust
)The commit status is updated on Gitea along the way.
[1] these are determined outdated in two cases: if the directory does not exist
at all, it is always considered outdated and recreated. Otherwise, fling
compares a hashsum of the configuration the image was built with with the
configuration that is desired, and if they mismatch, recreates the image
debootstrap
systemd-nspawn
git
root
access