ci: generate package list during compose via finalize.d
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:
+7
-12
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user