if all config was set in the config.json bypass the checks (#315)
This commit is contained in:
parent
1604e11a5b
commit
8adcd9e53b
@ -51,12 +51,9 @@ if [ "$1" = 'mattermost' ]; then
|
|||||||
jq '.SqlSettings.DriverName = "postgres"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
|
jq '.SqlSettings.DriverName = "postgres"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
|
||||||
jq '.SqlSettings.AtRestEncryptKey = "'$(generate_salt)'"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
|
jq '.SqlSettings.AtRestEncryptKey = "'$(generate_salt)'"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
|
||||||
jq '.PluginSettings.Directory = "/mattermost/plugins/"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
|
jq '.PluginSettings.Directory = "/mattermost/plugins/"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG
|
||||||
else
|
|
||||||
echo "Using existing config file" $MM_CONFIG
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Configure database access
|
# Configure database access
|
||||||
if [ -z "$MM_SQLSETTINGS_DATASOURCE" ]
|
if [[ -z "$MM_SQLSETTINGS_DATASOURCE" ]]
|
||||||
then
|
then
|
||||||
echo -ne "Configure database connection..."
|
echo -ne "Configure database connection..."
|
||||||
# URLEncode the password, allowing for special characters
|
# URLEncode the password, allowing for special characters
|
||||||
@ -66,13 +63,19 @@ if [ "$1" = 'mattermost' ]; then
|
|||||||
else
|
else
|
||||||
echo "Using existing database connection"
|
echo "Using existing database connection"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "Using existing config file" $MM_CONFIG
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -z "$DB_HOST" ]
|
||||||
|
then
|
||||||
# Wait for database to be reachable
|
# Wait for database to be reachable
|
||||||
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
|
||||||
do
|
do
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# Wait another second for the database to be properly started.
|
# Wait another second for the database to be properly started.
|
||||||
# Necessary to avoid "panic: Failed to open sql connection pq: the database system is starting up"
|
# Necessary to avoid "panic: Failed to open sql connection pq: the database system is starting up"
|
||||||
|
Reference in New Issue
Block a user