ci: Produce toolbox images

Toolbox is a convenient option for development, but setting up
the image with all dependencies is annoying at best, in particular
later in the cycle when `dnf builddep` is likely insufficient.

To address that, produce toolbox images for main and stable branches
that are based on the regular CI image, and update them whenever
the image version is updated. This guarantees that all build- and
runtime dependencies are included.

Unsurprisingly, the script that produces the image draws heavily
from freedesktop's ci-templates. The most notable difference
(other than being neither distro-agnostic nor generic) is that
tag names are fixed (toolbox:main, toolbox:43 etc.) to make them
easier to consume.

Instead, whether an image needs rebuilding is based on a custom
label that records the base image that was used.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2713>
This commit is contained in:
Florian Müllner 2023-03-16 19:01:45 +01:00 committed by Marge Bot
parent 27617ef0a3
commit a837285ae3
2 changed files with 111 additions and 1 deletions

View file

@ -13,7 +13,7 @@ stages:
- deploy
default:
image: registry.gitlab.gnome.org/gnome/mutter/fedora/37:x86_64-2023-02-22.0
image: $MUTTER_CI_IMAGE
# Cancel jobs if newer commits are pushed to the branch
interruptible: true
# Auto-retry jobs in case of infra failures
@ -26,6 +26,7 @@ default:
- 'api_failure'
variables:
MUTTER_CI_IMAGE: registry.gitlab.gnome.org/gnome/mutter/fedora/37:x86_64-2023-02-22.0
FDO_UPSTREAM_REPO: GNOME/gnome-shell
BUNDLE: "extensions-git.flatpak"
LINT_LOG: "eslint-report.xml"
@ -290,3 +291,13 @@ dist-tarball:
- build/meson-dist/$CI_PROJECT_NAME-$CI_COMMIT_TAG.tar.xz
rules:
- if: '$CI_COMMIT_TAG'
build-toolbox:
image: quay.io/freedesktop.org/ci-templates:container-build-base-2021-07-29.0
stage: deploy
needs: []
script:
- .gitlab-ci/build-toolbox-image.sh $MUTTER_CI_IMAGE
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PROJECT_NAMESPACE == "GNOME"'
- if: '$CI_COMMIT_BRANCH =~ /^gnome-[0-9-]+$/ && $CI_PROJECT_NAMESPACE == "GNOME"'