entrypoint.sh 1.1 KB

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. set -o errexit
  3. rsync -ra --delete /home/minecraft-out/ /home/minecraft/render/
  4. # Require MINECRAFT_VERSION environment variable to be set (no default assumed)
  5. if [ -z "$MINECRAFT_VERSION" ]; then
  6. echo "Expecting environment variable MINECRAFT_VERSION to be set to non-empty string. Exiting."
  7. exit 1
  8. fi
  9. # Download Minecraft client .jar (Contains textures used by Minecraft Overviewer)
  10. wget -N https://s3.amazonaws.com/Minecraft.Download/versions/${MINECRAFT_VERSION}/${MINECRAFT_VERSION}.jar -P /home/minecraft/.minecraft/versions/${MINECRAFT_VERSION}/
  11. # Run the world renders (One pass to make map, one to generate points of interests)
  12. if [ "$POI_ONLY" != "y" ]; then
  13. overviewer.py --config /home/minecraft/config.py $OVERVIEWER_PARAMS
  14. # Add Google Maps API key if the GOOGLE_MAPS_API_KEY environment variable is set
  15. if [ "$GOOGLE_MAPS_API_KEY" ]; then
  16. sed -i "s|https://maps.google.com/maps/api/js|&?key=${GOOGLE_MAPS_API_KEY}|g" /home/minecraft/render/index.html
  17. fi
  18. fi
  19. overviewer.py --config /home/minecraft/config.py --genpoi $OVERVIEWER_POI_PARAMS
  20. rsync -ra --delete /home/minecraft/render/ /home/minecraft-out