byggsteg means “build step” in the Norwegian language.
This is a simple CI/CD system written in Guile Scheme.
byggsteg
uses plain Guile with almost no dependencies to function, SXML, and some basic POSIX / UNIX utilities.
byggsteg
is a free software project with the aim of developing a suite of functionalities to allow engineers to deliver software quicker and with less friction.
The aim of byggsteg is to release you from your dependency on proprietary systems like GitHub actions. This allows you to create continuous integration and continuous delivery (CI & CD) pipelines in an easy way that are tailored to your needs and which you fully control.
My initial idea when developing byggsteg
revolves around my Haskell projects, which are hosted on GitHub and deployed to Amazon AWS EC2 compute.
I don’t mind having the software building and testing happening in the same machine as where I run the production workloads, since I am looking for supreme cost-efficiency, but it’s highly recommended that you do separate these things, if you can afford it.
And thus, I set out to build a CI/CD system, that on command can:
- clone specified repo URL to an isolated folder for each branch (but caching by reusing same branch and doing
git pull
) - navigate to that directory and perform a system command a.k.a. job (for a Haskell project
stack test
orstack build
or a combination of those) - capture the log output of all steps and save it
- record job in progress, success or failure
- show dashboard with job statuses
byggsteg
is a deploy-your-own type tool, but if enough community interest is shown a SaaS offering in freedom might be a really good thing.
You can run byggsteg
server by calling guile run-server.scm
from the root directory. Refer to the Makefile
for more convenient commands and variations.
byggsteg
exposes an HTML frontend (server-side-rendered SSR) and a REST API.
stack-test
- Haskell project build and test with Stack + Hackage bundle
stack-build
- Haskell project build with Stack + Hackage bundle
nix-build
- Nix build (flake)
byggsteg-version
- Byggsteg pull and restart systemd of itself
pull-and-restart
- Git pull and restart wanted systemd service
sbt-test
- Scala project test with SBT
You can use the UI and visit /jobs/request
or you can also invoke this via the REST API via URL encoded form data (application/x-www-form-urlencoded
).
You could do this for example from a GitHub action pipeline:
curl 'http://localhost:50023/api/jobs/submit' -X POST \
--data-urlencode "project=free-alacarte" \
--data-urlencode "branch-name=trunk" \
--data-urlencode "task=stack-test" \
--data-urlencode "clone-url=https://github.com/jjba23/free-alacarte"
#
# {"project": "free-alacarte",
# "task": "stack-test",
# "clone-url": "https://github.com/jjba23/free-alacarte",
# "branch-name": "trunk",
# "log-filename": "free-alacarte__2024-09-29__11:54:43.byggsteg.log",
# "public-log-filename": "667265652d616c6163"
# }
You can query for the job status via the UI or also via the REST API. You could implement a check to keep querying for job status until succeess or failure is true.
curl 'http://localhost:50023/api/logs/667265652d616c6163'
#
# {"success": true,
# "failure": false,
# "in-progress": false,
# "log-filename": "free-alacarte__2024-09-28__15:21:07.byggsteg.log",
# "log-data": "31353a32313a30372e627......."
# }
byggsteg
is licensed under the GNU GPL v3 License or newer.