Add some hand-holding

This commit is contained in:
Denis Dupeyron
2025-10-31 22:49:08 -06:00
parent 815c0fef38
commit 17952cd117

View File

@@ -3,8 +3,32 @@
set -euo pipefail
HERE=$(dirname "$(realpath "${0}")")
ANDROID_TARGETS="mainline optimized legacy"
LINUX_TARGETS="native amd64 steamdeck zen2 allyx rog-ally zen4 legacy aarch64 armv9"
if [[ "${#}" != 2 ]]; then
echo "${0} <android|linux> <${ANDROID_TARGETS// /|}|${LINUX_TARGETS// /|}>"
exit 1
fi
# Now we know ${1} isn't unbound
IMAGE="eden-${1}-builder"
if [[ "${1}" == "android" ]]; then
if [[ "$(grep " ${2} " <<< " ${ANDROID_TARGETS} ")" == "" ]]; then
echo "Android target must be one of: ${ANDROID_TARGETS}"
exit 1
fi
elif [[ "${1}" == "linux" ]]; then
if [[ "$(grep " ${2} " <<< " ${LINUX_TARGETS} ")" == "" ]]; then
echo "Linux target must be one of: ${LINUX_TARGETS}"
exit 1
fi
else
echo "Platform must be one of: android linux"
exit 1
fi
if [[ "$(docker images | grep "^${IMAGE} ")" == "" ]]; then
docker pull ubuntu
docker build --no-cache -t "${IMAGE}" -f "${HERE}/Dockerfile.${1}" "${HERE}"