2024-04-24 11:54:44 -07:00

34 lines
735 B
Bash
Executable File

#!/usr/bin/bash
set -oue pipefail
IMAGE_INFO="/usr/share/ublue-os/image-info.json"
IMAGE_REF="ostree-image-signed:docker://ghcr.io/$IMAGE_VENDOR/$IMAGE_NAME"
IMAGE_BRANCH_NORMALIZED=$IMAGE_BRANCH
if [[ $IMAGE_BRANCH_NORMALIZED == "main" ]]; then
IMAGE_BRANCH_NORMALIZED="stable"
fi
case $FEDORA_MAJOR_VERSION in
39|40)
IMAGE_TAG="stable"
;;
*)
IMAGE_TAG="$FEDORA_MAJOR_VERSION"
;;
esac
cat > $IMAGE_INFO <<EOF
{
"image-name": "$IMAGE_NAME",
"image-flavor": "$IMAGE_FLAVOR",
"image-vendor": "$IMAGE_VENDOR",
"image-ref": "$IMAGE_REF",
"image-tag": "$IMAGE_TAG",
"image-branch": "$IMAGE_BRANCH_NORMALIZED",
"base-image-name": "$BASE_IMAGE_NAME",
"fedora-version": "$FEDORA_MAJOR_VERSION"
}
EOF