summaryrefslogtreecommitdiffstats
path: root/src/main/bin/start.sh
diff options
context:
space:
mode:
authorDmitry Puzikov <dmitry.puzikov@tieto.com>2019-04-16 16:52:05 +0200
committerDmitry Puzikov <dmitry.puzikov@tieto.com>2019-08-29 09:23:11 +0200
commit86359a2f445a19a19d8239f2e7e07480a1bc7ba3 (patch)
treee96453b358dfd2168aa09f5bfb568f5bd214dd23 /src/main/bin/start.sh
parent378fac344f2de5a89b5410b9031e76841cd8fba6 (diff)
Fixed version parsing
Change-Id: Ibd37f998820dd4a77a6c320ce6b1066b06c86f51 Issue-ID: INT-798 Signed-off-by: Dmitry Puzikov <dmitry.puzikov@tieto.com>
Diffstat (limited to 'src/main/bin/start.sh')
-rw-r--r--src/main/bin/start.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/bin/start.sh b/src/main/bin/start.sh
index 038f4df..1dedb25 100644
--- a/src/main/bin/start.sh
+++ b/src/main/bin/start.sh
@@ -20,6 +20,13 @@
# ============LICENSE_END============================================
#*******************************************************************************
+# jre-alpine image has $JAVA_HOME set and added to $PATH
+# ubuntu image requires to set $JAVA_HOME and add java to $PATH manually
+if ( uname -v | grep -i "ubuntu" ); then
+ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-`dpkg --print-architecture | awk -F- '{ print $NF }'`
+ export PATH=${JAVA_HOME}:$PATH
+fi
+
# AJSC_HOME is required for EELF logging.
# This path is referenced in the file logback.xml.
AJSC_HOME="${AJSC_HOME-/opt/app/model-loader}"
@@ -30,8 +37,6 @@ if [ -z "$CONFIG_HOME" ]; then
exit 1
fi
-JARFILE="$AJSC_HOME/model-loader.jar"
-
# Some properties are repeated here for debugging purposes.
PROPS="-DAJSC_HOME=$AJSC_HOME"
PROPS="$PROPS -DCONFIG_HOME=$CONFIG_HOME"
@@ -52,5 +57,7 @@ if [ -z "${java_runtime_arguments}" ]; then
-Djava.rmi.server.hostname=127.0.0.1"
fi
+JARFILE=$(ls ./model-loader*.jar);
+
echo "java $java_runtime_arguments $PROPS -jar $JARFILE"
java $java_runtime_arguments $PROPS -jar $JARFILE