2021-04-30 14:47:07 +00:00
|
|
|
#!/bin/bash
|
2021-06-23 13:58:25 +00:00
|
|
|
|
2021-05-07 08:44:29 +00:00
|
|
|
/opt/envsubst < /envsubst_template.json > /conf/runtime.json
|
2021-06-23 11:43:00 +00:00
|
|
|
|
2021-06-24 15:12:31 +00:00
|
|
|
VERSION=$(date +%y%m%d%H%M%S)
|
|
|
|
|
2021-06-23 11:43:00 +00:00
|
|
|
if [ "x$GIT_BRIDGE_JVM_ARGS" == "x" ]; then
|
|
|
|
GIT_BRIDGE_JVM_ARGS="-XX:+UseContainerSupport -XX:MaxRAMPercentage=50.0"
|
|
|
|
fi
|
|
|
|
|
2021-06-23 13:58:25 +00:00
|
|
|
if [ "$ENABLE_PROFILE_AGENT" == "true" ]; then
|
2021-06-24 15:12:31 +00:00
|
|
|
GIT_BRIDGE_JVM_ARGS="-agentpath:/opt/cprof/profiler_java_agent.so=-cprof_service=git-bridge,-cprof_service_version=${VERSION},-cprof_enable_heap_sampling=true ${GIT_BRIDGE_JVM_ARGS}"
|
2021-06-23 13:58:25 +00:00
|
|
|
fi
|
|
|
|
|
2021-06-23 14:05:21 +00:00
|
|
|
if [ "$ENABLE_DEBUG_AGENT" == "true" ]; then
|
2021-06-24 15:12:31 +00:00
|
|
|
GIT_BRIDGE_JVM_ARGS="-agentpath:/opt/cdbg/cdbg_java_agent.so -Dcom.google.cdbg.module=git-bridge -Dcom.google.cdbg.version=$VERSION ${GIT_BRIDGE_JVM_ARGS}"
|
2021-06-23 14:05:21 +00:00
|
|
|
fi
|
|
|
|
|
2021-06-23 11:43:00 +00:00
|
|
|
exec java $GIT_BRIDGE_JVM_ARGS -jar /git-bridge.jar /conf/runtime.json
|