Reason for revert: This is blocking us from releasing the honolulu release - the...
[vid.git] / deliveries / src / main / scripts / localize.sh
1 #!/bin/bash
2
3 fillTemplateProperties() {
4   source /tmp/vid/localize_war.sh $1 || {
5         echo "ERROR: Localization script failed"
6         exit 2
7   }
8 }
9
10 createWritableLogbackConfig() {
11   # Create logback.xml in /tmp/vid/
12   # /tmp/logback.xml is owned by root and unmodifiable
13   cp -f /tmp/logback.xml /tmp/vid/logback.xml
14 }
15
16 if [ "${ON_KUBERNETES}" = "TRUE" ]
17 then
18   echo "We're running on Kubernetes, preconfiguration is already handled"
19 else
20   createWritableLogbackConfig
21   TEMPLATES_BASE_DIR=/usr/local/tomcat/webapps/vid/WEB-INF
22   fillTemplateProperties ${TEMPLATES_BASE_DIR}
23 fi
24
25 # Set CATALINA_OPTS if not defined previously
26 # Enables late-evaluation of env variables, such as VID_KEYSTORE_PASSWORD
27 : "${CATALINA_OPTS:=-Dvid.keystore.password=${VID_KEYSTORE_PASSWORD} -Dvid.keyalias=vid@vid.onap.org -Dvid.keystore.filename=${VID_KEYSTORE_FILENAME} -Dcom.att.eelf.logging.file=logback.xml -Dcom.att.eelf.logging.path=/tmp/vid/}"
28 echo "CATALINA_OPTS: ${CATALINA_OPTS}"
29 export CATALINA_OPTS
30
31 catalina.sh run