-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint
More file actions
49 lines (40 loc) · 1.65 KB
/
entrypoint
File metadata and controls
49 lines (40 loc) · 1.65 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
#!/bin/bash
trap 'kill -TERM $PID' TERM INT
# wait for jira lock file to disappear
if [ "$CHECK_LOCK_FILE" = true ]
then
while [ -f ${JIRA_HOME}/.jira-home.lock ]
do
sleep 1
echo "${JIRA_HOME}/.jira-home.lock is present ..."
echo waiting for other node to terminate
done
else
# If the instance crashes unexpectly, it's needed to remove the lock file in a non-cluster env
rm -f ${JIRA_HOME}/.jira-home.lock
fi
# update server.xml
cat conf/server.xml.orig > conf/server.xml
if [ ${CATALINA_CONNECTOR_PROXYNAME} ]
then
#xmlstarlet ed --insert Server/Service/Connector[@port=8080] --type attr -n proxyName -v ${CATALINA_CONNECTOR_PROXYNAME:-} conf/server.xml > conf/server.xml
xmlstarlet ed --inplace --insert Server/Service/Connector[@port=8080] --type attr -n proxyName -v ${CATALINA_CONNECTOR_PROXYNAME:-} conf/server.xml
fi
if [ ${CATALINA_CONNECTOR_PROXYPORT} ]
then
#xmlstarlet ed --insert Server/Service/Connector[@port=8080] --type attr -n proxyPort -v ${CATALINA_CONNECTOR_PROXYPORT:-} conf/server.xml > conf/server.xml
xmlstarlet ed --inplace --insert Server/Service/Connector[@port=8080] --type attr -n proxyPort -v ${CATALINA_CONNECTOR_PROXYPORT:-} conf/server.xml
fi
if [ ${CATALINA_CONNECTOR_SCHEME} ]
then
#xmlstarlet ed --insert Server/Service/Connector[@port=8080] --type attr -n scheme -v ${CATALINA_CONNECTOR_SCHEME:-} conf/server.xml > conf/server.xml
xmlstarlet ed --inplace --insert Server/Service/Connector[@port=8080] --type attr -n scheme -v ${CATALINA_CONNECTOR_SCHEME:-} conf/server.xml
fi
JAVA_HOME=/opt/java/openjdk/
export JAVA_HOME
./bin/catalina.sh run &
PID=$!
wait $PID
trap - TERM INT
wait $PID
EXIT_STATUS=$?