From d5810bcd7ed5f5349d7e0092250e69ee64c5f20b Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 24 Feb 2025 13:53:01 -0500 Subject: [PATCH] ci: Drop tier-x build, do build test case As part of all of this we're de-emphasizing "tier-x" and focusing on making it ergonomic to either build up from minimal, or down+up from standard. Second, also add a CI test for our derived image. Signed-off-by: Colin Walters --- .gitlab-ci.yml | 32 +++++++------------ ...le.test-c10s => Containerfile.test-derive} | 7 ++-- 2 files changed, 14 insertions(+), 25 deletions(-) rename tests/{Containerfile.test-c10s => Containerfile.test-derive} (85%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5c82de0..d25599d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,31 +3,21 @@ stages: - build variables: - IMAGE: ${CI_REGISTRY}/${CI_PROJECT_PATH}:${CI_COMMIT_SHA} - CONTAINERFILE: Containerfile - CONTEXT: . - EXTRA_ARGS: "" + PRIV_ARGS: "--security-opt=label=disable --cap-add=all --device /dev/fuse" .build-image: stage: build image: quay.io/buildah/stable:v1.38.0 needs: [] - script: buildah bud -f ${CONTAINERFILE} --no-cache -t ${IMAGE} ${EXTRA_ARGS} ${CONTEXT} - rules: - - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push" - when: never - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS - when: never -build-image: +build-minimal: extends: .build-image - parallel: - matrix: - - TIER: [minimal, standard, tier-x] - variables: - EXTRA_ARGS: "--security-opt=label=disable --cap-add=all --build-arg MANIFEST=fedora-$TIER" - rules: - - if: $CI_PROJECT_NAMESPACE != "fedora/bootc" - when: never - - if: $CI_PIPELINE_SOURCE == "merge_request_event" + script: buildah build -f Containerfile --no-cache -t localhost/fedora-bootc:minimal ${PRIV_ARGS} --build-arg=manifest=fedora-minimal . + +standard-build-and-test: + extends: .build-image + script: | + set -xeuo pipefail + buildah build --no-cache -t localhost/fedora-bootc ${PRIV_ARGS} . + cd tests + buildah build -f Containerfile.test-derive --no-cache -t localhost/fedora-bootc-derived ${PRIV_ARGS} . diff --git a/tests/Containerfile.test-c10s b/tests/Containerfile.test-derive similarity index 85% rename from tests/Containerfile.test-c10s rename to tests/Containerfile.test-derive index 2b6b4e6..52cd0a7 100644 --- a/tests/Containerfile.test-c10s +++ b/tests/Containerfile.test-derive @@ -1,7 +1,7 @@ # This test case exercises using the fedora-bootc image as a builder # to generate a minimal target image derived from CentOS Stream 10 content, # and then further extends it in a secondary phase. -FROM quay.io/centos/centos:stream10 as repos +FROM quay.io/fedora/fedora-bootc:rawhide as repos # This is intentionally a locally built image FROM localhost/fedora-bootc as builder @@ -12,16 +12,15 @@ FROM scratch COPY --from=builder /target-rootfs/ / RUN <