Merge pull request #152 from jnbt/master

Only configure database connection if needed
This commit is contained in:
Kyâne Pichou 2017-07-11 09:25:37 +02:00 committed by GitHub
commit c9a33c73bc

View File

@ -51,9 +51,14 @@ if [ "$1" = 'platform' ]; then
echo "Using existing config file" $MM_CONFIG echo "Using existing config file" $MM_CONFIG
fi fi
if [ -z "$MM_SQLSETTINGS_DATASOURCE"]
then
echo -ne "Configure database connection..." echo -ne "Configure database connection..."
export MM_SQLSETTINGS_DATASOURCE="postgres://$MM_USERNAME:$MM_PASSWORD@$DB_HOST:$DB_PORT_NUMBER/$MM_DBNAME?sslmode=disable&connect_timeout=10" export MM_SQLSETTINGS_DATASOURCE="postgres://$MM_USERNAME:$MM_PASSWORD@$DB_HOST:$DB_PORT_NUMBER/$MM_DBNAME?sslmode=disable&connect_timeout=10"
echo OK echo OK
else
echo "Using existing database connection"
fi
echo "Wait until database $DB_HOST:$DB_PORT_NUMBER is ready..." echo "Wait until database $DB_HOST:$DB_PORT_NUMBER is ready..."
until nc -z $DB_HOST $DB_PORT_NUMBER until nc -z $DB_HOST $DB_PORT_NUMBER