2025-09-19 15:40:44 -04:00
|
|
|
# The default entrypoint to working on this project.
|
2026-01-16 08:57:17 -05:00
|
|
|
# Run `just --list` to see available targets organized by group.
|
|
|
|
|
#
|
2025-09-22 14:48:13 -04:00
|
|
|
# See also `Makefile` and `xtask.rs`. Commands which end in `-local`
|
2025-10-31 17:47:17 -04:00
|
|
|
# skip containerization or virtualization (and typically just proxy `make`).
|
|
|
|
|
#
|
2026-01-16 08:57:17 -05:00
|
|
|
# By default the layering is:
|
2025-12-17 07:33:49 -05:00
|
|
|
# Github Actions -> Justfile -> podman -> make -> rustc
|
2026-01-16 08:57:17 -05:00
|
|
|
# -> podman -> package manager
|
2025-12-17 07:33:49 -05:00
|
|
|
# -> cargo xtask
|
2025-09-22 14:48:13 -04:00
|
|
|
# --------------------------------------------------------------------
|
2025-09-19 15:40:44 -04:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# Configuration variables (override via environment or command line)
|
|
|
|
|
# Example: BOOTC_base=quay.io/fedora/fedora-bootc:42 just build
|
|
|
|
|
|
|
|
|
|
# Output image name
|
2025-11-20 13:52:45 -05:00
|
|
|
base_img := "localhost/bootc"
|
2026-01-16 08:57:17 -05:00
|
|
|
# Synthetic upgrade image for testing
|
2026-01-06 14:56:15 -05:00
|
|
|
upgrade_img := base_img + "-upgrade"
|
2025-11-20 13:52:45 -05:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# Build variant: ostree (default) or composefs-sealeduki-sdboot (sealed UKI)
|
Rework GHA testing: Use bcvk, cover composefs with tmt
Part 1: Use bcvk
For local tests, right now testcloud+tmt doesn't support UEFI, see
https://github.com/teemtee/tmt/issues/4203
This is a blocker for us doing more testing with UKIs.
In this patch we switch to provisioning VMs with bcvk, which
fixes this - but beyond that a really compelling thing about
this is that bcvk is *also* designed to be ergonomic and efficient
beyond just being a test runner, with things like virtiofs
mounting of host container storage, etc.
In other words, bcvk is the preferred way to run local virt
with bootc, and this makes our TMT tests use it.
Now a major downside of this though is we're effectively
implementing a new "provisioner" for tmt (bypassing the
existing `virtual`). In the more medium term I think we
want to add `bcvk` as a provisioner option to tmt.
Anyways for now, this works by discovers test plans via `tmt plan ls`,
spawning a separate VM per test, and then using uses tmt's connect
provisioner to run tests targeting these externally provisioned
systems.
Part 2: Rework the Justfile and Dockerfile
This adds `base` and `variant` arguments which are propagated through
the system, and we have a new `variant` for sealed composefs.
The readonly tests now pass with composefs.
Drop the continuous repo tests...as while we could keep
that it's actually a whole *other* entry in this matrix.
Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-04 09:20:56 -05:00
|
|
|
variant := env("BOOTC_variant", "ostree")
|
2026-01-16 08:57:17 -05:00
|
|
|
# Base container image to build from
|
Rework GHA testing: Use bcvk, cover composefs with tmt
Part 1: Use bcvk
For local tests, right now testcloud+tmt doesn't support UEFI, see
https://github.com/teemtee/tmt/issues/4203
This is a blocker for us doing more testing with UKIs.
In this patch we switch to provisioning VMs with bcvk, which
fixes this - but beyond that a really compelling thing about
this is that bcvk is *also* designed to be ergonomic and efficient
beyond just being a test runner, with things like virtiofs
mounting of host container storage, etc.
In other words, bcvk is the preferred way to run local virt
with bootc, and this makes our TMT tests use it.
Now a major downside of this though is we're effectively
implementing a new "provisioner" for tmt (bypassing the
existing `virtual`). In the more medium term I think we
want to add `bcvk` as a provisioner option to tmt.
Anyways for now, this works by discovers test plans via `tmt plan ls`,
spawning a separate VM per test, and then using uses tmt's connect
provisioner to run tests targeting these externally provisioned
systems.
Part 2: Rework the Justfile and Dockerfile
This adds `base` and `variant` arguments which are propagated through
the system, and we have a new `variant` for sealed composefs.
The readonly tests now pass with composefs.
Drop the continuous repo tests...as while we could keep
that it's actually a whole *other* entry in this matrix.
Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-04 09:20:56 -05:00
|
|
|
base := env("BOOTC_base", "quay.io/centos-bootc/centos-bootc:stream10")
|
2026-01-16 08:57:17 -05:00
|
|
|
# Buildroot base image
|
2025-11-28 17:11:07 +08:00
|
|
|
buildroot_base := env("BOOTC_buildroot_base", "quay.io/centos/centos:stream10")
|
2026-01-16 08:57:17 -05:00
|
|
|
# Optional: path to extra source (e.g. composefs-rs) for local development
|
2026-01-22 17:47:29 -05:00
|
|
|
# DEPRECATED: Use [patch] sections in Cargo.toml instead, which are auto-detected
|
2026-01-16 08:57:17 -05:00
|
|
|
extra_src := env("BOOTC_extra_src", "")
|
2026-01-22 17:47:29 -05:00
|
|
|
# Set to "1" to disable auto-detection of local Rust dependencies
|
|
|
|
|
no_auto_local_deps := env("BOOTC_no_auto_local_deps", "")
|
Rework GHA testing: Use bcvk, cover composefs with tmt
Part 1: Use bcvk
For local tests, right now testcloud+tmt doesn't support UEFI, see
https://github.com/teemtee/tmt/issues/4203
This is a blocker for us doing more testing with UKIs.
In this patch we switch to provisioning VMs with bcvk, which
fixes this - but beyond that a really compelling thing about
this is that bcvk is *also* designed to be ergonomic and efficient
beyond just being a test runner, with things like virtiofs
mounting of host container storage, etc.
In other words, bcvk is the preferred way to run local virt
with bootc, and this makes our TMT tests use it.
Now a major downside of this though is we're effectively
implementing a new "provisioner" for tmt (bypassing the
existing `virtual`). In the more medium term I think we
want to add `bcvk` as a provisioner option to tmt.
Anyways for now, this works by discovers test plans via `tmt plan ls`,
spawning a separate VM per test, and then using uses tmt's connect
provisioner to run tests targeting these externally provisioned
systems.
Part 2: Rework the Justfile and Dockerfile
This adds `base` and `variant` arguments which are propagated through
the system, and we have a new `variant` for sealed composefs.
The readonly tests now pass with composefs.
Drop the continuous repo tests...as while we could keep
that it's actually a whole *other* entry in this matrix.
Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-04 09:20:56 -05:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# Internal variables
|
2026-01-16 13:37:11 -05:00
|
|
|
nocache := env("BOOTC_nocache", "")
|
|
|
|
|
_nocache_arg := if nocache != "" { "--no-cache" } else { "" }
|
2025-11-08 10:50:42 -05:00
|
|
|
testimage_label := "bootc.testimage=1"
|
2025-12-02 20:45:40 -05:00
|
|
|
lbi_images := "quay.io/curl/curl:latest quay.io/curl/curl-base:latest registry.access.redhat.com/ubi9/podman:latest"
|
2026-01-16 08:57:17 -05:00
|
|
|
fedora-coreos := "quay.io/fedora/fedora-coreos:testing-devel"
|
2025-12-02 20:45:40 -05:00
|
|
|
generic_buildargs := ""
|
2026-01-13 20:41:22 -05:00
|
|
|
_extra_src_args := if extra_src != "" { "-v " + extra_src + ":/run/extra-src:ro --security-opt=label=disable" } else { "" }
|
|
|
|
|
base_buildargs := generic_buildargs + " " + _extra_src_args + " --build-arg=base=" + base + " --build-arg=variant=" + variant
|
2025-12-17 13:19:24 -05:00
|
|
|
buildargs := base_buildargs \
|
|
|
|
|
+ " --cap-add=all --security-opt=label=type:container_runtime_t --device /dev/fuse" \
|
|
|
|
|
+ " --secret=id=secureboot_key,src=target/test-secureboot/db.key --secret=id=secureboot_cert,src=target/test-secureboot/db.crt"
|
2026-01-16 08:57:17 -05:00
|
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
# Core workflows - the main targets most developers will use
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
|
|
|
|
# Build container image from current sources (default target)
|
|
|
|
|
[group('core')]
|
2026-01-06 14:56:15 -05:00
|
|
|
build: package _keygen && _pull-lbi-images
|
2025-12-18 11:27:24 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
set -xeuo pipefail
|
|
|
|
|
test -d target/packages
|
|
|
|
|
pkg_path=$(realpath target/packages)
|
2026-01-16 13:37:11 -05:00
|
|
|
podman build {{_nocache_arg}} --build-context "packages=${pkg_path}" -t {{base_img}} {{buildargs}} .
|
2026-01-06 14:56:15 -05:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# Show available build variants and current configuration
|
|
|
|
|
[group('core')]
|
|
|
|
|
list-variants:
|
2025-12-16 13:31:22 -05:00
|
|
|
#!/bin/bash
|
2026-01-16 08:57:17 -05:00
|
|
|
cat <<'EOF'
|
|
|
|
|
Build Variants (set via BOOTC_variant= or variant=)
|
|
|
|
|
====================================================
|
2025-12-16 13:31:22 -05:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
ostree (default)
|
|
|
|
|
Standard bootc image using ostree backend.
|
|
|
|
|
This is the traditional, production-ready configuration.
|
2025-10-02 02:32:52 +02:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
composefs-sealeduki-sdboot
|
|
|
|
|
Sealed composefs image with:
|
|
|
|
|
- Unified Kernel Image (UKI) containing kernel + initramfs + cmdline
|
|
|
|
|
- Secure Boot signing (using keys in target/test-secureboot/)
|
|
|
|
|
- systemd-boot bootloader
|
|
|
|
|
- composefs digest embedded in kernel cmdline for verified boot
|
2025-11-19 14:19:20 -05:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
Use `just build-sealed` as a shortcut, or:
|
|
|
|
|
just variant=composefs-sealeduki-sdboot build
|
2025-11-26 10:00:33 -05:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
Current Configuration
|
|
|
|
|
=====================
|
|
|
|
|
EOF
|
|
|
|
|
echo " BOOTC_variant={{variant}}"
|
|
|
|
|
echo " BOOTC_base={{base}}"
|
|
|
|
|
echo " BOOTC_extra_src={{extra_src}}"
|
|
|
|
|
echo ""
|
2025-10-02 02:32:52 +02:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# Build a sealed composefs image (alias for variant=composefs-sealeduki-sdboot)
|
|
|
|
|
[group('core')]
|
|
|
|
|
build-sealed:
|
|
|
|
|
@just --justfile {{justfile()}} variant=composefs-sealeduki-sdboot build
|
2026-01-13 20:44:54 -05:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# Run tmt integration tests in VMs (e.g. `just test-tmt readonly`)
|
|
|
|
|
[group('core')]
|
|
|
|
|
test-tmt *ARGS: build
|
|
|
|
|
@just _build-upgrade-image
|
|
|
|
|
@just test-tmt-nobuild {{ARGS}}
|
2025-06-06 11:11:58 -04:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# Run containerized unit and integration tests
|
|
|
|
|
[group('core')]
|
|
|
|
|
test-container: build build-units
|
|
|
|
|
podman run --rm --read-only localhost/bootc-units /usr/bin/bootc-units
|
|
|
|
|
podman run --rm --env=BOOTC_variant={{variant}} --env=BOOTC_base={{base}} {{base_img}} bootc-integration-tests container
|
2025-07-17 14:38:21 -04:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# Build and test sealed composefs images
|
|
|
|
|
[group('core')]
|
|
|
|
|
test-composefs:
|
|
|
|
|
just variant=composefs-sealeduki-sdboot test-tmt readonly local-upgrade-reboot
|
2025-09-22 14:48:13 -04:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# Run cargo fmt and clippy checks in container
|
|
|
|
|
[group('core')]
|
2025-09-22 14:48:13 -04:00
|
|
|
validate:
|
2025-11-08 10:50:42 -05:00
|
|
|
podman build {{base_buildargs}} --target validate .
|
2025-09-22 14:48:13 -04:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# ============================================================================
|
|
|
|
|
# Testing variants and utilities
|
|
|
|
|
# ============================================================================
|
2025-11-20 13:52:45 -05:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# Run tmt tests without rebuilding (for fast iteration)
|
|
|
|
|
[group('testing')]
|
2025-11-20 13:52:45 -05:00
|
|
|
test-tmt-nobuild *ARGS:
|
2026-01-06 14:56:15 -05:00
|
|
|
cargo xtask run-tmt --env=BOOTC_variant={{variant}} --upgrade-image={{upgrade_img}} {{base_img}} {{ARGS}}
|
2025-09-22 14:48:13 -04:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# Run tmt tests on Fedora CoreOS
|
|
|
|
|
[group('testing')]
|
|
|
|
|
test-tmt-on-coreos *ARGS:
|
|
|
|
|
cargo xtask run-tmt --env=BOOTC_variant={{variant}} --env=BOOTC_target={{base_img}}-coreos:latest {{fedora-coreos}} {{ARGS}}
|
|
|
|
|
|
|
|
|
|
# Run external container tests against localhost/bootc
|
|
|
|
|
[group('testing')]
|
|
|
|
|
run-container-external-tests:
|
|
|
|
|
./tests/container/run {{base_img}}
|
|
|
|
|
|
|
|
|
|
# Remove all test VMs created by tmt tests
|
|
|
|
|
[group('testing')]
|
|
|
|
|
tmt-vm-cleanup:
|
|
|
|
|
bcvk libvirt rm --stop --force --label bootc.test=1
|
|
|
|
|
|
|
|
|
|
# Build test image for Fedora CoreOS testing
|
|
|
|
|
[group('testing')]
|
2026-01-06 14:56:15 -05:00
|
|
|
build-testimage-coreos PATH: _keygen
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
set -xeuo pipefail
|
|
|
|
|
pkg_path=$(realpath "{{PATH}}")
|
2026-01-08 11:33:40 -05:00
|
|
|
podman build --build-context "packages=${pkg_path}" \
|
2026-01-06 14:56:15 -05:00
|
|
|
--build-arg SKIP_CONFIGS=1 \
|
2026-01-08 11:33:40 -05:00
|
|
|
-t {{base_img}}-coreos {{buildargs}} .
|
2025-12-19 17:30:46 +08:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# Build test image for install tests (used by CI)
|
|
|
|
|
[group('testing')]
|
|
|
|
|
build-install-test-image: build
|
|
|
|
|
cd hack && podman build {{base_buildargs}} -t {{base_img}}-install -f Containerfile.drop-lbis
|
Rework GHA testing: Use bcvk, cover composefs with tmt
Part 1: Use bcvk
For local tests, right now testcloud+tmt doesn't support UEFI, see
https://github.com/teemtee/tmt/issues/4203
This is a blocker for us doing more testing with UKIs.
In this patch we switch to provisioning VMs with bcvk, which
fixes this - but beyond that a really compelling thing about
this is that bcvk is *also* designed to be ergonomic and efficient
beyond just being a test runner, with things like virtiofs
mounting of host container storage, etc.
In other words, bcvk is the preferred way to run local virt
with bootc, and this makes our TMT tests use it.
Now a major downside of this though is we're effectively
implementing a new "provisioner" for tmt (bypassing the
existing `virtual`). In the more medium term I think we
want to add `bcvk` as a provisioner option to tmt.
Anyways for now, this works by discovers test plans via `tmt plan ls`,
spawning a separate VM per test, and then using uses tmt's connect
provisioner to run tests targeting these externally provisioned
systems.
Part 2: Rework the Justfile and Dockerfile
This adds `base` and `variant` arguments which are propagated through
the system, and we have a new `variant` for sealed composefs.
The readonly tests now pass with composefs.
Drop the continuous repo tests...as while we could keep
that it's actually a whole *other* entry in this matrix.
Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
2025-11-04 09:20:56 -05:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# ============================================================================
|
|
|
|
|
# Documentation
|
|
|
|
|
# ============================================================================
|
2025-11-08 10:50:42 -05:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# Serve docs locally (prints URL)
|
|
|
|
|
[group('docs')]
|
|
|
|
|
mdbook-serve: build-mdbook
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
set -xeuo pipefail
|
|
|
|
|
podman run --init --replace -d --name bootc-mdbook --rm --publish 127.0.0.1::8000 localhost/bootc-mdbook
|
|
|
|
|
echo http://$(podman port bootc-mdbook 8000/tcp)
|
2025-09-04 18:11:14 -04:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# Build the documentation (mdbook)
|
|
|
|
|
[group('docs')]
|
2025-09-25 13:42:22 -04:00
|
|
|
build-mdbook:
|
2026-01-08 10:30:02 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
set -xeuo pipefail
|
|
|
|
|
secret_arg=""
|
|
|
|
|
if test -n "${GH_TOKEN:-}"; then
|
|
|
|
|
secret_arg="--secret=id=GH_TOKEN,env=GH_TOKEN"
|
|
|
|
|
fi
|
|
|
|
|
podman build {{generic_buildargs}} ${secret_arg} -t localhost/bootc-mdbook -f docs/Dockerfile.mdbook .
|
2025-09-25 13:42:22 -04:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# Build docs and extract to DIR
|
|
|
|
|
[group('docs')]
|
2025-09-25 13:42:22 -04:00
|
|
|
build-mdbook-to DIR: build-mdbook
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
set -xeuo pipefail
|
|
|
|
|
container_id=$(podman create localhost/bootc-mdbook)
|
2026-01-07 13:01:30 -05:00
|
|
|
podman cp ${container_id}:/src/docs/book {{DIR}}
|
2025-09-25 13:42:22 -04:00
|
|
|
podman rm -f ${container_id}
|
|
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# ============================================================================
|
|
|
|
|
# Debugging and validation
|
|
|
|
|
# ============================================================================
|
2025-09-25 13:42:22 -04:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# Validate composefs digests match between build and install views
|
|
|
|
|
[group('debugging')]
|
|
|
|
|
validate-composefs-digest:
|
|
|
|
|
cargo xtask validate-composefs-digest {{base_img}}
|
2025-12-16 13:31:22 -05:00
|
|
|
|
2026-01-16 08:57:17 -05:00
|
|
|
# Verify reproducible builds (runs package twice, compares output)
|
|
|
|
|
[group('debugging')]
|
2025-12-16 13:31:22 -05:00
|
|
|
check-buildsys:
|
|
|
|
|
cargo run -p xtask check-buildsys
|
2026-01-16 08:57:17 -05:00
|
|
|
|
|
|
|
|
# Get container image pullspec for a given OS (e.g. `pullspec-for-os base fedora-42`)
|
|
|
|
|
[group('debugging')]
|
|
|
|
|
pullspec-for-os TYPE NAME:
|
|
|
|
|
@jq -r --arg v "{{NAME}}" '."{{TYPE}}"[$v]' < hack/os-image-map.json
|
|
|
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
# Maintenance
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
|
|
|
|
# Update generated files (man pages, JSON schemas)
|
|
|
|
|
[group('maintenance')]
|
|
|
|
|
update-generated:
|
|
|
|
|
cargo run -p xtask update-generated
|
|
|
|
|
|
|
|
|
|
# Remove all locally-built test container images
|
|
|
|
|
[group('maintenance')]
|
|
|
|
|
clean-local-images:
|
|
|
|
|
podman images --filter "label={{testimage_label}}"
|
|
|
|
|
podman images --filter "label={{testimage_label}}" --format "{{{{.ID}}" | xargs -r podman rmi -f
|
|
|
|
|
podman image prune -f
|
|
|
|
|
podman rmi {{fedora-coreos}} -f
|
|
|
|
|
|
|
|
|
|
# Build packages (RPM) into target/packages/
|
|
|
|
|
[group('maintenance')]
|
|
|
|
|
package:
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
set -xeuo pipefail
|
|
|
|
|
packages=target/packages
|
|
|
|
|
if test -n "${BOOTC_SKIP_PACKAGE:-}"; then
|
|
|
|
|
if test '!' -d "${packages}"; then
|
|
|
|
|
echo "BOOTC_SKIP_PACKAGE is set, but missing ${packages}" 1>&2; exit 1
|
|
|
|
|
fi
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
eval $(just _git-build-vars)
|
|
|
|
|
echo "Building RPM with version: ${VERSION}"
|
2026-01-22 17:47:29 -05:00
|
|
|
# Auto-detect local Rust path dependencies (e.g., from [patch] sections)
|
|
|
|
|
local_deps_args=""
|
|
|
|
|
if [[ -z "{{no_auto_local_deps}}" ]]; then
|
|
|
|
|
local_deps_args=$(cargo xtask local-rust-deps)
|
|
|
|
|
fi
|
|
|
|
|
podman build {{base_buildargs}} --build-arg=SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} --build-arg=pkgversion=${VERSION} -t localhost/bootc-pkg --target=build $local_deps_args .
|
2026-01-16 08:57:17 -05:00
|
|
|
mkdir -p "${packages}"
|
|
|
|
|
rm -vf "${packages}"/*.rpm
|
|
|
|
|
podman run --rm localhost/bootc-pkg tar -C /out/ -cf - . | tar -C "${packages}"/ -xvf -
|
|
|
|
|
chmod a+rx target "${packages}"
|
|
|
|
|
chmod a+r "${packages}"/*.rpm
|
|
|
|
|
|
|
|
|
|
# Build unit tests into a container image
|
|
|
|
|
[group('maintenance')]
|
|
|
|
|
build-units:
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
set -xeuo pipefail
|
|
|
|
|
eval $(just _git-build-vars)
|
|
|
|
|
podman build {{base_buildargs}} --build-arg=SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} --build-arg=pkgversion=${VERSION} --target units -t localhost/bootc-units .
|
|
|
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
# Internal helpers (prefixed with _)
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
|
|
|
|
_pull-lbi-images:
|
|
|
|
|
podman pull -q --retry 5 --retry-delay 5s {{lbi_images}}
|
|
|
|
|
|
|
|
|
|
_git-build-vars:
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
|
|
|
|
|
if VERSION=$(git describe --tags --exact-match 2>/dev/null); then
|
|
|
|
|
VERSION="${VERSION#v}"
|
|
|
|
|
VERSION="${VERSION//-/.}"
|
|
|
|
|
else
|
|
|
|
|
COMMIT=$(git rev-parse HEAD | cut -c1-10)
|
|
|
|
|
COMMIT_TS=$(git show -s --format=%ct)
|
|
|
|
|
TIMESTAMP=$(date -u -d @${COMMIT_TS} +%Y%m%d%H%M)
|
|
|
|
|
VERSION="${TIMESTAMP}.g${COMMIT}"
|
|
|
|
|
fi
|
|
|
|
|
echo "SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH}"
|
|
|
|
|
echo "VERSION=${VERSION}"
|
|
|
|
|
|
|
|
|
|
_keygen:
|
|
|
|
|
./hack/generate-secureboot-keys
|
|
|
|
|
|
|
|
|
|
_build-upgrade-image:
|
|
|
|
|
cat tmt/tests/Dockerfile.upgrade | podman build -t {{upgrade_img}} --from={{base_img}} -
|