-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·59 lines (50 loc) · 1.75 KB
/
Copy pathrun.sh
File metadata and controls
executable file
·59 lines (50 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
echo "Starting application..."
# Set debug logging if DEBUG environment variable is set to true
if [ "${DEBUG:-false}" = "true" ]; then
echo " Debug logging enabled"
export LOG_LEVEL=DEBUG
else
echo " Debug logging disabled"
export LOG_LEVEL=INFO
fi
# echo some settings
echo " SYNDICATION_CHECK_ON_STARTUP=${SYNDICATION_CHECK_ON_STARTUP:-true}"
echo " TERMHUB_URL=${TERMHUB_URL:-https://api.terminologyhub.com}"
echo " SERVER_PORT=${SERVER_PORT:-8080}"
if [ -z "${PROJECT_API_KEY+x}" ]; then
echo " PROJECT_API_KEY is NOT set"
else
echo " PROJECT_API_KEY is set"
fi
# Verify index exists and is writeable
indexDir="${INDEX_DIR:-/index}"
echo " INDEX_DIR=$indexDir"
if [ -d $indexDir ]; then
echo " Index directory $indexDir exists"
else
echo " Index directory $indexDir does not exist - make it"
mkdir $indexDir
fi
if [ -w "$indexDir" ]; then
echo " Index directory $indexDir is writeable"
else
echo " Index directory $indexDir is not writeable"
exit 1
fi
if [[ `ls build/libs/open-termhub-*.jar 2> /dev/null | wc -l` -eq 1 ]]; then
# First form exists
jar_file=$(ls build/libs/open-termhub-*.jar)
echo " Found jar file = $jar_file"
elif [[ `ls open-termhub-*.jar 2> /dev/null | wc -l` -eq 1 ]]; then
# Second form exists
jar_file=$(ls open-termhub-*.jar)
log_file=log4j2-deploy.xml
echo " Found jar file = $jar_file"
else
# Neither exists
echo "'build/libs/open-termhub-*.jar' nor 'open-termhub-*.jar' could be found."
exit 1
fi
echo "java ${JAVA_OPTS:=} -Xms512M -XX:+UseZGC -XX:+UseStringDeduplication -Dspring.profiles.active=deploy -jar $jar_file"
java ${JAVA_OPTS:=} -Xms512M -XX:+UseZGC -XX:+UseStringDeduplication -Dspring.profiles.active=deploy -jar $jar_file