[SOGo] Wait for updated db schema before bootstrapping

master
andryyy 2018-11-16 22:48:28 +01:00
parent 7998ec3f1f
commit f011db317e
2 changed files with 12 additions and 1 deletions

View File

@ -13,6 +13,17 @@ do
sleep 3
done
# Wait for updated schema
DBV_NOW=$(mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "SELECT version FROM versions;" -BN)
DBV_NEW=$(grep -oE '\$db_version = .*;' init_db.inc.php | sed 's/$db_version = //g;s/;//g' | cut -d \" -f2)
while [[ ${DBV_NOW} != ${DBV_NEW} ]]; do
echo "Waiting for schema update..."
DBV_NOW=$(mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "SELECT version FROM versions;" -BN)
DBV_NEW=$(grep -oE '\$db_version = .*;' init_db.inc.php | sed 's/$db_version = //g;s/;//g' | cut -d \" -f2)
sleep 5
done
echo "DB schema is ${DBV_NOW}"
# Recreate view
mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "DROP VIEW IF EXISTS sogo_view"

View File

@ -138,7 +138,7 @@ services:
- phpfpm
sogo-mailcow:
image: mailcow/sogo:1.42
image: mailcow/sogo:1.43
build: ./data/Dockerfiles/sogo
environment:
- DBNAME=${DBNAME}