jjba23 / byggsteg

Byggsteg is the free as in freedom CI/CD orchestrator written in Guile Scheme

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

byggsteg

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.

What is byggsteg ?

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 or stack 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.

Using

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.

Types of jobs

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

Starting a job

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......."
# }

Licensing

byggsteg is licensed under the GNU GPL v3 License or newer.

Project management - backlog

Hot reload server

Improve JSON support

Allow user to send Guile Scheme over the wire and define his/her own pipeline in a progn fashion.

Add REPL interface via website, to allow hot-modifications

✅ Work done

Concurrency primitives and usage

Split codebase into separate modules

About

Byggsteg is the free as in freedom CI/CD orchestrator written in Guile Scheme

License:GNU General Public License v3.0


Languages

Language:Scheme 98.3%Language:Makefile 1.0%Language:JavaScript 0.6%