How hard would it be to implement a simple CI task that gets Blubber source code from Gerrit, builds it with Go, and runs its unit tests?
Description
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | • LarsWirzenius | T217325 Consider and evaluate possible new CI tooling | |||
| Resolved | zeljkofilipin | T217852 Evaluate sourcehut builds |
Event Timeline
Working build manifest: https://git.sr.ht/~brennen/blubber/tree/sourcehut_test/.build.yml
Notes:
sourcehut is a suite of interoperable tools for code hosting, issue tracking, CI, etc., described as "the hacker's forge". The web interface is minimal but effective. Individual components can be used standalone. The software overall is licensed AGPL, and a hosted / paid instance is available at sr.ht. Payment is optional on the hosted instance as the project is still in relatively early stages. From glancing over some of the repositories, it seems to be implemented largely in Python and Go.
Builds are described by a YAML build manifest like so:
image: debian/testing packages: - golang - golint - build-essential sources: - https://git.sr.ht/~brennen/blubber tasks: - build: | cd blubber make - test: | cd blubber make test
There's also a .buildenv file available for storing state between build steps. Builds are run inside virtual machines; available VM images include variants of Alpine Linux, Arch, Debian, Ubuntu, Fedora, FreeBSD, and NixOS. This is explicitly not a container-based workflow, although presumably one could be built on top of it. Builds can be triggered by way of an API, or by pushing to a repository with a defined .build.yml.
I didn't experiment with it, but there's also a task-dispatching system / job runner of sorts, and builds can contain deploy tasks which publish artifacts.
I pushed a clone of blubber to the code hosting, tested the above manifest for building and running the unit tests. Links:
- build manifest: https://git.sr.ht/~brennen/blubber/tree/sourcehut_test/.build.yml
- blubber repo: https://builds.sr.ht/~brennen/blubber
- a failed build: https://builds.sr.ht/~brennen/job/35319
- a successful build: https://builds.sr.ht/~brennen/job/35320
Overall this was a pleasant and straightforward experience. I suspect that it may be somewhat immature for our purposes, it's not really container-centric, and I'm not sure about complexity of hosting. That said, I quite like the workflow and interface, and it certainly delivers on self-serve CI for the basic case.
I've tested sourcehut too, and I really like it.
The workflow is exactly what we are looking for:
That's it!
Minimal:
image: debian/unstable
tasks:
- echo: |
echo "hello world!"Final:
image: debian/unstable
packages:
- golang
- golint
- build-essential
tasks:
- make: |
cd blubber
make
- unit: |
cd blubber
make unit
- test: |
cd blubber
make test