mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 11:48:05 +00:00
entrypoint.sh: Wait for DB to start up
- Added wait-for-it.sh - use wait-for-it.sh to wait for pgsql / mysql DB before running `artisan` commands
This commit is contained in:
@@ -51,6 +51,18 @@ echo "Discover packages..."
|
||||
php artisan package:discover
|
||||
|
||||
echo "Run various artisan commands..."
|
||||
. $FIREFLY_PATH/.env
|
||||
if [[ -z "$DB_PORT" ]]; then
|
||||
if [[ $DB_CONNECTION == "pgsql" ]]; then
|
||||
DB_PORT=5432
|
||||
elif [[ $DB_CONNECTION == "mysql" ]]; then
|
||||
DB_PORT=3306
|
||||
fi
|
||||
fi
|
||||
if [[ ! -z "$DB_PORT" ]]; then
|
||||
$FIREFLY_PATH/.deploy/docker/wait-for-it.sh "${DB_HOST}:${DB_PORT}" -- echo "db is up. Time to execute artisan commands"
|
||||
fi
|
||||
#env $(grep -v "^\#" .env | xargs)
|
||||
php artisan migrate --seed
|
||||
php artisan firefly:decrypt-all
|
||||
php artisan firefly:upgrade-database
|
||||
@@ -61,4 +73,4 @@ php artisan cache:clear
|
||||
php artisan firefly:instructions install
|
||||
|
||||
echo "Go!"
|
||||
exec apache2-foreground
|
||||
exec apache2-foreground
|
||||
|
Reference in New Issue
Block a user