Make MifosX installation a bit less error-prone

This commit is contained in:
Disassembler 2018-12-10 09:31:18 +01:00
parent bbf8219504
commit b4f5979354
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
5 changed files with 15 additions and 16 deletions

View File

@ -31,7 +31,7 @@ COPY lxc
RUN EOF RUN EOF
# Install Czech translation # Install Czech translation
cd /srv/frontlinesms/frontlinesms2/web-app/assets/i18n cd /srv/frontlinesms/frontlinesms2/web-app/assets/i18n
gzip < frontlinesms-core_messages_cs.js > frontlinesms-core_messages_cs.js.gz gzip <frontlinesms-core_messages_cs.js >frontlinesms-core_messages_cs.js.gz
MD5=$(md5sum frontlinesms-core_messages_cs.js | cut -d' ' -f1) MD5=$(md5sum frontlinesms-core_messages_cs.js | cut -d' ' -f1)
cp frontlinesms-core_messages_cs.js frontlinesms-core_messages_cs-${MD5}.js cp frontlinesms-core_messages_cs.js frontlinesms-core_messages_cs-${MD5}.js
cp frontlinesms-core_messages_cs.js.gz frontlinesms-core_messages_cs-${MD5}.js.gz cp frontlinesms-core_messages_cs.js.gz frontlinesms-core_messages_cs-${MD5}.js.gz

View File

@ -24,13 +24,14 @@ cp etc/init.d/mifosx /etc/init.d/mifosx
rc-update -u rc-update -u
# Populate database # Populate database
>/var/log/lxc/mifosx.log
service mifosx start service mifosx start
until grep -q 'Migrating schema `mifostenant-default` to version 5000' /var/log/lxc/mifosx.log; do until grep -q 'org.apache.catalina.startup.Catalina.start Server startup' /var/log/lxc/mifosx.log; do
sleep 1 sleep 1
done done
service mifosx stop service mifosx stop
# Fix missing previous_run_status column # Fix missing previous_run_status column
echo 'ALTER TABLE `scheduled_email_campaign` ADD `previous_run_status` VARCHAR(10) NULL;' | lxc-attach mariadb -- mysql mifostenant-default #echo 'ALTER TABLE `scheduled_email_campaign` ADD `previous_run_status` VARCHAR(10) NULL;' | lxc-attach mariadb -- mysql mifostenant-default
# Update admin account # Update admin account
export MIFOSX_ADMIN_USER=admin export MIFOSX_ADMIN_USER=admin

View File

@ -1 +1 @@
UPDATE tenants SET timezone_id = "Europe/Prague", schema_server = "mariadb", schema_username = "mifosx", schema_password = "${MIFOSX_PWD}" WHERE identifier = "default"; UPDATE `tenants` SET `timezone_id` = "Europe/Prague", `schema_server` = "mariadb", `schema_username` = "mifosx", `schema_password` = "${MIFOSX_PWD}" WHERE `identifier` = "default";

View File

@ -4,14 +4,12 @@ LAYER shared/java
LAYER shared/tomcat LAYER shared/tomcat
LAYER mifosx/mifosx LAYER mifosx/mifosx
COPY lxc
RUN EOF RUN EOF
# Install full-featured wget to work around sourceforge bugs # Install full-featured wget to work around sourceforge bugs
apk --no-cache add wget apk --no-cache add wget
# Download Mifos X # Download Mifos X
wget https://sourceforge.net/projects/mifos/files/latest/download -O /tmp/mifosx.zip wget https://sourceforge.net/projects/mifos/files/Mifos%20X/mifosplatform-18.03.01.RELEASE.zip/download -O /tmp/mifosx.zip
mkdir /srv/tomcat/webapps/fineract-provider mkdir /srv/tomcat/webapps/fineract-provider
unzip /tmp/mifosx.zip -d /tmp unzip /tmp/mifosx.zip -d /tmp
unzip /tmp/fineractplatform-18.03.01.RELEASE/fineract-provider.war -d /srv/tomcat/webapps/fineract-provider unzip /tmp/fineractplatform-18.03.01.RELEASE/fineract-provider.war -d /srv/tomcat/webapps/fineract-provider
@ -29,19 +27,19 @@ RUN EOF
# Cleanup # Cleanup
apk --no-cache del wget apk --no-cache del wget
rm -rf /tmp/fineractplatform-18.03.01.RELEASE /tmp/mifosx.zip rm -rf /tmp/fineractplatform-18.03.01.RELEASE /tmp/mifosx.zip
# Update Czech translation of community-app
wget 'https://translatewiki.net/wiki/Special:ExportTranslations?group=out-mifos&language=cs&format=export-to-file' -O /srv/tomcat/webapps/ROOT/global-translations/locale-cs.json
cd /srv/tomcat/webapps/ROOT/scripts/
# Apply translation patch
patch -p0 </tmp/locale-cs.patch
rm /tmp/locale-cs.patch
EOF EOF
# s6 required for single service due to hanging threads # s6 required for single service due to hanging threads
COPY lxc COPY lxc
RUN EOF
# Update Czech translation of community-app
wget 'https://translatewiki.net/wiki/Special:ExportTranslations?group=out-mifos&language=cs&format=export-to-file' -O /srv/tomcat/webapps/ROOT/global-translations/locale-cs.json
cd /srv/tomcat/webapps/ROOT/scripts/
patch -p0 </tmp/locale-cs.patch
rm /tmp/locale-cs.patch
EOF
MOUNT FILE /srv/mifosx/conf/server.xml srv/tomcat/conf/server.xml MOUNT FILE /srv/mifosx/conf/server.xml srv/tomcat/conf/server.xml
MOUNT FILE /srv/mifosx/conf/context.xml srv/tomcat/webapps/fineract-provider/META-INF/context.xml MOUNT FILE /srv/mifosx/conf/context.xml srv/tomcat/webapps/fineract-provider/META-INF/context.xml

View File

@ -25,7 +25,7 @@ rc-update -u
# Populate database # Populate database
service opendatakit start service opendatakit start
until grep -q 'org.apache.catalina.startup.Catalina.start' /var/log/lxc/opendatakit.log; do until grep -q 'org.apache.catalina.startup.Catalina.start Server startup' /var/log/lxc/opendatakit.log; do
sleep 1 sleep 1
done done
service opendatakit stop service opendatakit stop