Skip to content

Build a custom ci-fairy capable image

Peter Hutterer requested to merge whot/ci-templates:wip/ci-fairy-image into master

It's easy enough to install ci-fairy via pip from git, but doing so requires an image that's capable of pip. This again means either alpine from docker (it's small but we'll be ratelimited very soon), or some other image that each project generates on its own.

Let's assume that several projects have common requirements for a small reusable image: either basic git checks, python+pip (e.g. flake8 checks) or ci-fairy. And that we don't want to run afoul docker hub's pull limits, so we have a need to host this image locally.

This patch adds it as the .fdo.ci-fairy template to every distribution-specific template. This is just for convenience, the image itself is always the same and not based on that distribution. So where any template is included, ci-fairy can be used like this:

   check-mr:
     extends:
       - .fdo.ci-fairy
     script:
      - ci-fairy check-merge-request --require-allow-collaboration

The image is built with a hardcoded image path of ci-fairy/latest and rebuilt as part of the CI, so all jobs will use the most recent image. The alternative of git-sha tagged images would require us to keep every possible image around forever, just in case there's one project that references that particular sha.

Note: I added this as image in every template, the alternative is to have a templates/ci-fairy.yml to include which is more complicated to use (nested includes!) but long-term could be more flexible. Was about 50-50 on either option but adding it by default means it's available by default. ** I decided to make this a separate image after all, long-term plan are to have other templates that employ ci-fairy in the background so having this in a specific template file is a better choice.**

Fixes #17 (closed)

TODO:

  • publish to quay.io
Edited by Peter Hutterer

Merge request reports