ci: generate package list during compose via finalize.d
Build containers / fedora-cosmic (rawhide) (push) Successful in 11m54s
Build containers / fedora-cosmic (44) (push) Successful in 12m56s

Avoid mounting the built image with buildah (ran out of disk); the
finalize.d hook records the rpm list next to the treefile and release.sh
consumes it directly.
This commit is contained in:
2026-09-21 17:35:17 +02:00
parent 0a05b2a6bc
commit de5b0f143a
4 changed files with 29 additions and 15 deletions
+7 -12
View File
@@ -2,7 +2,7 @@
# Generate a package changelog for a freshly built image and publish it as a
# Gitea release (instead of committing JSON files under changelogs/).
#
# Usage: release.sh <image> <distro> <buildid> <ociarchive>
# Usage: release.sh <image> <distro> <buildid> <packages-file>
#
# The full package list is attached to each release as
# packages-<image>-<distro>.txt
@@ -10,21 +10,21 @@
set -euo pipefail
if [[ $# -lt 4 ]]; then
echo "Usage: $0 <image> <distro> <buildid> <ociarchive>" >&2
echo "Usage: $0 <image> <distro> <buildid> <packages-file>" >&2
exit 1
fi
IMAGE="$1"
DISTRO="$2"
BUILDID="$3"
OCI_ARCHIVE="$4"
PACKAGES_FILE="$4"
GITEA_URL="${GITEA_URL:-https://git.plabble.org}"
GITEA_REPO="${GITEA_REPO:-Misthios/bootc-images}"
TOKEN="${RELEASE_TOKEN:-${GITHUB_TOKEN:-}}"
[[ -n "${TOKEN}" ]] || { echo "RELEASE_TOKEN (or GITHUB_TOKEN) is required" >&2; exit 1; }
[[ -f "${OCI_ARCHIVE}" ]] || { echo "Missing OCI archive: ${OCI_ARCHIVE}" >&2; exit 1; }
[[ -f "${PACKAGES_FILE}" ]] || { echo "Missing package list: ${PACKAGES_FILE}" >&2; exit 1; }
API="${GITEA_URL%/}/api/v1/repos/${GITEA_REPO}"
RELEASE_TAG="${IMAGE}-${DISTRO}.${BUILDID}"
@@ -41,14 +41,9 @@ if curl -fsSL -H "Authorization: token ${TOKEN}" \
exit 0
fi
# --- package list from the built image -------------------------------------
echo "Extracting package list from ${OCI_ARCHIVE} ..."
export STORAGE_DRIVER=vfs
ctr="$(buildah from "oci-archive:${OCI_ARCHIVE}")"
mnt="$(buildah mount "${ctr}")"
rpm -qa --root "${mnt}" --qf '%{NAME} %{EVR}\n' | sort > "${WORK}/packages-current.txt"
buildah unmount "${ctr}"
buildah rm "${ctr}" >/dev/null
# --- package list from the build -------------------------------------------
echo "Using package list ${PACKAGES_FILE} ..."
cp "${PACKAGES_FILE}" "${WORK}/packages-current.txt"
# --- previous package list from the last release ---------------------------
# Walk the release list (newest first) until we find the newest release for