Allow overriding JVM args with an environment variable

This commit is contained in:
Simon Detheridge 2021-06-23 12:43:00 +01:00
parent 830b7f54fc
commit f51b8139e9
2 changed files with 7 additions and 2 deletions

View file

@ -7,7 +7,7 @@ runtime-conf:
run: package runtime-conf
java -jar \
java $(GIT_BRIDGE_JVM_ARGS) -jar \
target/writelatex-git-bridge-1.0-SNAPSHOT-jar-with-dependencies.jar \
conf/runtime.json

View file

@ -1,3 +1,8 @@
#!/bin/bash
/opt/envsubst < /envsubst_template.json > /conf/runtime.json
exec java -XX:+UseContainerSupport -XX:MaxRAMPercentage=50.0 -Xlog:gc* -jar /git-bridge.jar /conf/runtime.json
if [ "x$GIT_BRIDGE_JVM_ARGS" == "x" ]; then
GIT_BRIDGE_JVM_ARGS="-XX:+UseContainerSupport -XX:MaxRAMPercentage=50.0"
fi
exec java $GIT_BRIDGE_JVM_ARGS -jar /git-bridge.jar /conf/runtime.json