ENHANCEMENT: installing demo data if required

This commit is contained in:
Jeroen De Meerleer 2022-08-12 10:39:05 +02:00
parent ab71b84787
commit 19b89d2787
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
1 changed files with 7 additions and 6 deletions

View File

@ -71,13 +71,8 @@ DB_PORT=$(php -r "echo parse_url('$DATABASE_URL')['port'];")
DB_NAME=$(php -r "echo parse_url('$DATABASE_URL')['path'];")
echo "Wait for the database."
if [[ -z "$DB_PORT" ]]; then
if [[ $DB_CONNECTION == "pgsql" ]]; then
DB_PORT=5432
elif [[ $DB_CONNECTION == "mysql" ]]; then
if [[ $DB_CONNECTION == "mysql" ]]; then
DB_PORT=3306
elif [[ $DB_CONNECTION == "sqlite" ]]; then
touch $DB_NAME
echo "Touched!"
fi
fi
if [[ -n "$DB_PORT" ]]; then
@ -128,6 +123,12 @@ else
echo 'Running report commands...'
fi
# report commands
if [[ $DEMO_MODE == "true" ]]; then
echo 'Installing demo data'
su - www-data -s "/bin/bash" -c "php $WEBCRON_ROOT/bin/console install:demodata"
fi
php bin/console cache:clear
php bin/console cache:warm