jimmydot | 8b8addd | 2017-05-08 18:00:46 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
kurczews | 7b8621d | 2018-09-19 08:17:52 +0200 | [diff] [blame] | 3 | fillTemplateProperties() { |
| 4 | source /tmp/vid/localize_war.sh $1 || { |
| 5 | echo "ERROR: Localization script failed" |
| 6 | exit 2 |
| 7 | } |
jimmydot | 8b8addd | 2017-05-08 18:00:46 -0400 | [diff] [blame] | 8 | } |
| 9 | |
Ittay Stern | 9dff984 | 2019-12-19 16:26:17 +0200 | [diff] [blame] | 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 | |
kurczews | 7b8621d | 2018-09-19 08:17:52 +0200 | [diff] [blame] | 16 | deployWarOnTomcatManually() { |
| 17 | cd /usr/local/tomcat/webapps/ |
| 18 | mkdir vid |
| 19 | cd vid |
| 20 | jar -xf /tmp/vid/stage/vid.war |
| 21 | } |
| 22 | |
Ittay Stern | 9dff984 | 2019-12-19 16:26:17 +0200 | [diff] [blame] | 23 | |
| 24 | createWritableLogbackConfig |
kurczews | 7b8621d | 2018-09-19 08:17:52 +0200 | [diff] [blame] | 25 | deployWarOnTomcatManually |
| 26 | |
| 27 | TEMPLATES_BASE_DIR=/usr/local/tomcat/webapps/vid/WEB-INF |
| 28 | |
| 29 | fillTemplateProperties ${TEMPLATES_BASE_DIR} |
| 30 | |
Ittay Stern | 479b73d | 2019-12-12 16:55:01 +0200 | [diff] [blame] | 31 | # Set CATALINA_OPTS if not defined previously |
| 32 | # Enables late-evaluation of env variables, such as VID_KEYSTORE_PASSWORD |
Ittay Stern | 9dff984 | 2019-12-19 16:26:17 +0200 | [diff] [blame] | 33 | : "${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 Stern | 479b73d | 2019-12-12 16:55:01 +0200 | [diff] [blame] | 34 | echo "CATALINA_OPTS: ${CATALINA_OPTS}" |
| 35 | export CATALINA_OPTS |
| 36 | |
jimmydot | 8b8addd | 2017-05-08 18:00:46 -0400 | [diff] [blame] | 37 | catalina.sh run |