diff --git a/build.sh b/build.sh index cbb0292..4c8339a 100644 --- a/build.sh +++ b/build.sh @@ -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)."