Skip to content

Gentoo Build Publisher is a way to build gentoo updates in CI/CD and have those builds published (rsync for the portage tree; http for binpkgs) to individual machines.

License

Notifications You must be signed in to change notification settings

erglabs/gentoo-build-publisher

 
 

Repository files navigation

Gentoo Build Publisher dashboard

Gentoo Build Publisher

Introduction

The idea is to combine best practices with continuous integration and other tools to deliver successful, consistent "builds" to your Gentoo machine(s).

In case you didn't know, Gentoo Linux is a source-based rolling-release meta-distribution that you can twist and mold into pretty much anything you like. That's just a verbose way of saying Gentoo is awesome.

If you run a Gentoo system, say a laptop, you may be updating your system using the standard emerge --sync followed by a world update. This pulls in the latest ebuilds from the Gentoo repo and if there are any updates applicable to your system then they get built on your system.

Except sometimes they don't.

Sometimes builds fail. Sometimes USE flags need to be changed. Sometimes there's an update to a piece of software that is buggy and you want to revert. Sometimes a build takes a long time and you don't want to wait.

Well since Gentoo is the distribution you build yourself, CI/CD seems like a natural fit. Enter Gentoo Build Publisher.

Gentoo Build Publisher is the combination of an rsync server (for ebuild repos and machine configs) and HTTP server (for binpkgs) for successful builds. For Jenkins it is a gateway to publish builds. For my real machines it the source for repo syncs and binpkgs.

Procedure

  • Build a Gentoo Build Publisher instance. Refer to the Install Guide.
  • Create "machines" and "repos" jobs in Jenkins. Use the following git repo as a starting point.
  • Once a Jenkins job has been pulled by Gentoo Build Publisher it can be published so that actual machines can use it (e.g. rsync for repos, http for binpkgs). Use the CLI (gbp publish) to publish a pulled build.
  • If the job fails, it will not be pulled.
  • Your real machine, for example, base, syncs from, rsync://gbp/repos/base/gentoo. You can dynamically acquire the repos.conf file from https://gbp/machines/base/repos.conf and the binrepos.conf from https://gbp/machines/base/binrepos.conf.

Jenkins build

I have a git repo called machines that contains the profiles for all the machines whose builds I want to push to the publisher. You can fork the gbp-machines repo as a starting point.

My Jenkins job does not publish a build by default. I (can) later publish the build so that my machines can consume them. There is a GraphQL interface for doing such tasks as well as a command-line interface.

CLI

The command-line interface can inspect, publish, pull, schedule builds and more.

Articles

Below are some articles I've written that explain some aspects of Build Publisher in detail.

About

Gentoo Build Publisher is a way to build gentoo updates in CI/CD and have those builds published (rsync for the portage tree; http for binpkgs) to individual machines.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 95.6%
  • HTML 2.9%
  • Other 1.5%