From 2e8e7df185b499d633f112fdf1d07ff5eb1dbf82 Mon Sep 17 00:00:00 2001 From: Sylvain Desbureaux Date: Thu, 25 Jun 2020 14:13:58 +0200 Subject: Allow to run on read only root fs In order to be able to run on read only root fs, two changes have been done: * unpack tomcat war at container creation * launch the property file configuration conditionnally If "ON_KUBERNETES" environment variable is set to "TRUE" (default is "FALSE" for backward compatibility), the proper have to be set at boot via configmap on Kubernetes for example. Changes are backward compatible and shouldn't change actual behavior per default. Issue-ID: VID-850 Signed-off-by: Sylvain Desbureaux Change-Id: I6f96e2ca55093ee899be18d6ce4c2dfd7c1a5792 --- deliveries/src/main/scripts/localize.sh | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'deliveries/src/main/scripts/localize.sh') diff --git a/deliveries/src/main/scripts/localize.sh b/deliveries/src/main/scripts/localize.sh index d149e3bae..e4b8c220d 100755 --- a/deliveries/src/main/scripts/localize.sh +++ b/deliveries/src/main/scripts/localize.sh @@ -13,20 +13,14 @@ createWritableLogbackConfig() { cp -f /tmp/logback.xml /tmp/vid/logback.xml } -deployWarOnTomcatManually() { - cd /usr/local/tomcat/webapps/ - mkdir vid - cd vid - jar -xf /tmp/vid/stage/vid.war -} - - -createWritableLogbackConfig -deployWarOnTomcatManually - -TEMPLATES_BASE_DIR=/usr/local/tomcat/webapps/vid/WEB-INF - -fillTemplateProperties ${TEMPLATES_BASE_DIR} +if [ "${ON_KUBERNETES}" = "TRUE" ] +then + echo "We're running on Kubernetes, preconfiguration is already handled" +else + createWritableLogbackConfig + TEMPLATES_BASE_DIR=/usr/local/tomcat/webapps/vid/WEB-INF + fillTemplateProperties ${TEMPLATES_BASE_DIR} +fi # Set CATALINA_OPTS if not defined previously # Enables late-evaluation of env variables, such as VID_KEYSTORE_PASSWORD -- cgit 1.2.3-korg