Pass JVM memory options to Spigot build

Fixes #292
This commit is contained in:
Geoff Bourne 2019-02-26 22:19:43 -06:00
parent fe3df584ef
commit aef8f54903

View File

@ -1,12 +1,21 @@
#!/bin/bash #!/bin/bash
set -e
function buildSpigotFromSource { function buildSpigotFromSource {
echo "Building Spigot $VANILLA_VERSION from source, might take a while, get some coffee" echo "Building Spigot $VANILLA_VERSION from source, might take a while, get some coffee"
mkdir /data/temp mkdir /data/temp
cd /data/temp cd /data/temp
jvmOpts="-Xms${INIT_MEMORY:-$MEMORY} -Xmx${MAX_MEMORY:-$MEMORY}"
curl -sSL -o /data/temp/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar && \ curl -sSL -o /data/temp/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar && \
java -jar /data/temp/BuildTools.jar --rev $VANILLA_VERSION 2>&1 |tee /data/spigot_build.log| while read l; do echo -n .; done; echo "done" java $jvmOpts -jar /data/temp/BuildTools.jar --rev $VANILLA_VERSION 2>&1 |tee /data/spigot_build.log| while read l; do echo -n .; done; echo "done"
mv spigot-*.jar /data/spigot_server.jar if ! mv spigot-*.jar /data/spigot_server.jar; then
echo "ERR failed to build Spigot"
cat /data/spigot_build.log
exit 1
fi
mv craftbukkit-*.jar /data/craftbukkit_server.jar mv craftbukkit-*.jar /data/craftbukkit_server.jar
echo "Cleaning up" echo "Cleaning up"
rm -rf /data/temp rm -rf /data/temp