blob: d149e3baef0082e8d9b0582066a79dce7e22b9ad [file] [log] [blame]
jimmydot8b8addd2017-05-08 18:00:46 -04001#!/bin/bash
2
kurczews7b8621d2018-09-19 08:17:52 +02003fillTemplateProperties() {
4 source /tmp/vid/localize_war.sh $1 || {
5 echo "ERROR: Localization script failed"
6 exit 2
7 }
jimmydot8b8addd2017-05-08 18:00:46 -04008}
9
Ittay Stern9dff9842019-12-19 16:26:17 +020010createWritableLogbackConfig() {
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
kurczews7b8621d2018-09-19 08:17:52 +020016deployWarOnTomcatManually() {
17 cd /usr/local/tomcat/webapps/
18 mkdir vid
19 cd vid
20 jar -xf /tmp/vid/stage/vid.war
21}
22
Ittay Stern9dff9842019-12-19 16:26:17 +020023
24createWritableLogbackConfig
kurczews7b8621d2018-09-19 08:17:52 +020025deployWarOnTomcatManually
26
27TEMPLATES_BASE_DIR=/usr/local/tomcat/webapps/vid/WEB-INF
28
29fillTemplateProperties ${TEMPLATES_BASE_DIR}
30
Ittay Stern479b73d2019-12-12 16:55:01 +020031# Set CATALINA_OPTS if not defined previously
32# Enables late-evaluation of env variables, such as VID_KEYSTORE_PASSWORD
Ittay Stern9dff9842019-12-19 16:26:17 +020033: "${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/}"
Ittay Stern479b73d2019-12-12 16:55:01 +020034echo "CATALINA_OPTS: ${CATALINA_OPTS}"
35export CATALINA_OPTS
36
jimmydot8b8addd2017-05-08 18:00:46 -040037catalina.sh run