Fix MifosX install script

This commit is contained in:
Disassembler 2019-12-13 21:40:27 +01:00
parent 0e465b0820
commit 7426ff6f9c
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499

View File

@ -13,21 +13,22 @@ export MIFOSX_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=')
service lxc-mifosx-mariadb start
envsubst <createdb.sql | lxc-attach mifosx-mariadb -- mysql -u mysql
# Configure Mifos X
mkdir -p /srv/mifosx/mifosx_conf
envsubst <mifosx_conf/context.xml >/srv/mifosx/mifosx_conf/context.xml
cp mifosx_conf/server.xml /srv/mifosx/mifosx_conf/server.xml
chown -R 100000:100000 /srv/mifosx/mifosx_conf
# Populate database
lxc-execute mifosx -- cat /tmp/mifospltaform-tenants-first-time-install.sql | lxc-attach mifosx-mariadb -- mysql -u mysql mifosplatform-tenants
envsubst <schemapwd.sql | lxc-attach mifosx-mariadb -- mysql -u mysql mifosplatform-tenants
# Configure Mifos X
mkdir -p /srv/mifosx_conf
envsubst <mifosx_conf/context.xml >/srv/mifosx/mifosx_conf/context.xml
cp mifosx_conf/server.xml /srv/mifosx/mifosx_conf/server.xml
# Populate database
service start mifosx
service lxc-mifosx start
until grep -q 'org.apache.catalina.startup.Catalina.start Server startup' /var/log/lxc/mifosx.log; do
sleep 1
done
service stop mifosx
service lxc-mifosx stop
# Fix missing previous_run_status column
echo 'ALTER TABLE `scheduled_email_campaign` ADD `previous_run_status` VARCHAR(10) NULL;' | lxc-attach mifosx-mariadb -- mysql -u mysql mifostenant-default