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 <walters@verbum.org>
This commit is contained in:
parent
c89b6f4298
commit
d5810bcd7e
2 changed files with 14 additions and 25 deletions
|
|
@ -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} .
|
||||
|
|
|
|||
|
|
@ -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 <<EORUN
|
||||
set -xeuo pipefail
|
||||
# Verify we have CentOS content
|
||||
. /usr/lib/os-release
|
||||
test "$ID" = centos
|
||||
test "$ID" = fedora
|
||||
|
||||
# And install a package
|
||||
dnf -y install strace
|
||||
dnf clean all
|
||||
|
||||
# Cleanup and lint
|
||||
rm /var/log /var/cache/* /var/lib/dnf
|
||||
rm -rf /var/log /var/cache/* /var/lib/dnf
|
||||
bootc container lint
|
||||
EORUN
|
||||
LABEL containers.bootc 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue