chore: export more vars as readonly

This commit is contained in:
ER
2023-08-13 17:29:11 +03:00
parent 93cd25fe01
commit 8f0aa9cec9

View File

@@ -14,13 +14,16 @@ get_yaml_array() {
}
export -f get_yaml_array # this makes the function available to all modules
# Automatically determine which Fedora version we're building.
export FEDORA_VERSION="$(grep -Po '(?<=VERSION_ID=)\d+' /usr/lib/os-release)"
# Declare dynamically generated variables as read-only and exported
declare -rx IMAGE_NAME BASE_IMAGE FEDORA_VERSION
# Read configuration variables.
BASE_IMAGE="$(yq '.base-image' "$RECIPE_FILE")"
IMAGE_NAME="$(yq '.name' "$RECIPE_FILE")"
# Automatically determine which Fedora version we're building.
FEDORA_VERSION="$(grep -Po '(?<=VERSION_ID=)\d+' /usr/lib/os-release)"
# Welcome.
echo "Building $IMAGE_NAME from Fedora $FEDORA_VERSION ($BASE_IMAGE)."