diff options
author | Sylvain Desbureaux <sylvain.desbureaux@orange.com> | 2020-06-25 14:13:58 +0200 |
---|---|---|
committer | Ikram Ikramullah <ikram@research.att.com> | 2020-08-12 20:09:00 +0000 |
commit | 2e8e7df185b499d633f112fdf1d07ff5eb1dbf82 (patch) | |
tree | 5aa5afd5e8b55c34bff999c867ff56de280ef718 /deliveries/src/main/scripts | |
parent | 32af6479c686d217204de3a86940ac1256da4b9f (diff) |
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 <sylvain.desbureaux@orange.com>
Change-Id: I6f96e2ca55093ee899be18d6ce4c2dfd7c1a5792
Diffstat (limited to 'deliveries/src/main/scripts')
-rwxr-xr-x | deliveries/src/main/scripts/localize.sh | 22 |
1 files changed, 8 insertions, 14 deletions
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 |