[TOOLS][DOCKER] Use a more robust way to check for database availability
This commit is contained in:
parent
e22fe55bbe
commit
91fecd77ba
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
case "${DBMS}" in
|
case "${DBMS}" in
|
||||||
'postgres')
|
'postgres')
|
||||||
PGPASSWORD="${POSTGRES_PASSWORD}" psql -ltq -Upostgres -hdb | \
|
test "$(PGPASSWORD="${POSTGRES_PASSWORD}" psql -Upostgres -hdb -tAc "select 1 from pg_database where datname='${SOCIAL_DB}'")" = "1"
|
||||||
cut -d '|' -f1 | grep -Fwq "${SOCIAL_DB}"
|
|
||||||
DB_EXISTS=$?
|
DB_EXISTS=$?
|
||||||
;;
|
;;
|
||||||
'mariadb')
|
'mariadb')
|
||||||
@ -28,7 +27,8 @@ if [ ${DB_EXISTS} -ne 0 ]; then
|
|||||||
chmod g+w -R .
|
chmod g+w -R .
|
||||||
chown -R :www-data .
|
chown -R :www-data .
|
||||||
|
|
||||||
php bin/console doctrine:database:create || exit 1
|
php bin/console doctrine:database:drop -f
|
||||||
|
php bin/console doctrine:database:create
|
||||||
php bin/console doctrine:schema:create || exit 1
|
php bin/console doctrine:schema:create || exit 1
|
||||||
php bin/console app:populate_initial_values || exit 1
|
php bin/console app:populate_initial_values || exit 1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user