2018-02-18 00:06:57 +07:00
|
|
|
#!/usr/bin/env bash
|
2018-05-06 00:45:04 +07:00
|
|
|
if [[ $# -eq 0 ]] ; then
|
|
|
|
echo 'A build version must be supplied as the first argument.'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-12-29 05:33:17 +07:00
|
|
|
cd ..
|
|
|
|
|
2018-05-06 00:45:04 +07:00
|
|
|
./gradlew server:dist -Pbuildversion=$1
|
2019-12-29 04:30:40 +07:00
|
|
|
|
2019-12-29 05:33:17 +07:00
|
|
|
excode=$?
|
|
|
|
|
|
|
|
if [ $excode -ne 0 ]; then
|
|
|
|
echo $excode
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-12-29 04:30:40 +07:00
|
|
|
while true; do
|
|
|
|
#auto-restart until ctrl-c or exit 0
|
2019-05-05 00:17:31 +07:00
|
|
|
java -jar -XX:+HeapDumpOnOutOfMemoryError server/build/libs/server-release.jar
|
2019-12-29 04:30:40 +07:00
|
|
|
excode=$?
|
|
|
|
if [ $excode -eq 0 ] || [ $excode -eq 130 ]; then
|
2019-12-29 05:33:17 +07:00
|
|
|
exit 0
|
2019-12-29 04:30:40 +07:00
|
|
|
fi
|
|
|
|
done
|