diff --git a/scripts/build-image.sh b/scripts/build-image.sh index 1b92b5c..f08d8b2 100755 --- a/scripts/build-image.sh +++ b/scripts/build-image.sh @@ -34,6 +34,19 @@ if [ -z "${GAMECI_VERSION}" ]; then GAMECI_VERSION=3 fi +# Ensure IMAGE_OS is set, default to ubuntu if not +if [ -z "${IMAGE_OS}" ]; then + IMAGE_OS="ubuntu" + + # windows-il2cpp requires windows OS + if [ "${UNITY_PLATFORM}" = "windows-il2cpp" ]; then + IMAGE_OS="windows" + fi + + # TODO: MacOS probably requires a mac image. + # Might be worth just putting this in the strategy at this point +fi + # Ensure PLATFORM is set, default to the current system if not if [ -z "${PLATFORM}" ]; then PLATFORM=$(uname -m) @@ -47,8 +60,9 @@ if [ -z "${PLATFORM}" ]; then esac fi -BASE_IMAGE=unityci/editor:ubuntu-${UNITY_VERSION}-${UNITY_PLATFORM}-${GAMECI_VERSION} -TAG=ubuntu-${UNITY_VERSION}-${UNITY_PLATFORM}-runner + +BASE_IMAGE=unityci/editor:${IMAGE_OS}-${UNITY_VERSION}-${UNITY_PLATFORM}-${GAMECI_VERSION} +TAG=${IMAGE_OS}-${UNITY_VERSION}-${UNITY_PLATFORM}-runner FULL_IMAGE=${IMAGE}:${TAG} echo "Building Docker image ${FULL_IMAGE}"