chore: sync with API Platform

This commit is contained in:
Kévin Dunglas 2023-09-15 17:49:22 +02:00
parent 81c2a77ed5
commit 253eae0e15
3 changed files with 7 additions and 6 deletions

1
.gitattributes vendored
View File

@ -11,6 +11,7 @@
*.yaml text eol=lf *.yaml text eol=lf
*.yml text eol=lf *.yml text eol=lf
bin/console text eol=lf bin/console text eol=lf
composer.lock text eol=lf merge=ours
*.ico binary *.ico binary
*.png binary *.png binary

View File

@ -20,7 +20,7 @@ services:
- host.docker.internal:host-gateway - host.docker.internal:host-gateway
caddy: caddy:
command: [ "caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile", "--watch" ] command: [ "caddy", "run", "--config", "/etc/caddy/Caddyfile", "--watch" ]
build: build:
context: . context: .
target: caddy_base target: caddy_base

View File

@ -32,9 +32,9 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
fi fi
if grep -q ^DATABASE_URL= .env; then if grep -q ^DATABASE_URL= .env; then
echo "Waiting for db to be ready..." echo "Waiting for database to be ready..."
ATTEMPTS_LEFT_TO_REACH_DATABASE=60 ATTEMPTS_LEFT_TO_REACH_DATABASE=60
until [ $ATTEMPTS_LEFT_TO_REACH_DATABASE -eq 0 ] || DATABASE_ERROR=$(bin/console dbal:run-sql "SELECT 1" 2>&1); do until [ $ATTEMPTS_LEFT_TO_REACH_DATABASE -eq 0 ] || DATABASE_ERROR=$(php bin/console dbal:run-sql -q "SELECT 1" 2>&1); do
if [ $? -eq 255 ]; then if [ $? -eq 255 ]; then
# If the Doctrine command exits with 255, an unrecoverable error occurred # If the Doctrine command exits with 255, an unrecoverable error occurred
ATTEMPTS_LEFT_TO_REACH_DATABASE=0 ATTEMPTS_LEFT_TO_REACH_DATABASE=0
@ -42,7 +42,7 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
fi fi
sleep 1 sleep 1
ATTEMPTS_LEFT_TO_REACH_DATABASE=$((ATTEMPTS_LEFT_TO_REACH_DATABASE - 1)) ATTEMPTS_LEFT_TO_REACH_DATABASE=$((ATTEMPTS_LEFT_TO_REACH_DATABASE - 1))
echo "Still waiting for db to be ready... Or maybe the db is not reachable. $ATTEMPTS_LEFT_TO_REACH_DATABASE attempts left" echo "Still waiting for database to be ready... Or maybe the database is not reachable. $ATTEMPTS_LEFT_TO_REACH_DATABASE attempts left."
done done
if [ $ATTEMPTS_LEFT_TO_REACH_DATABASE -eq 0 ]; then if [ $ATTEMPTS_LEFT_TO_REACH_DATABASE -eq 0 ]; then
@ -50,11 +50,11 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
echo "$DATABASE_ERROR" echo "$DATABASE_ERROR"
exit 1 exit 1
else else
echo "The db is now ready and reachable" echo "The database is now ready and reachable"
fi fi
if [ "$( find ./migrations -iname '*.php' -print -quit )" ]; then if [ "$( find ./migrations -iname '*.php' -print -quit )" ]; then
bin/console doctrine:migrations:migrate --no-interaction php bin/console doctrine:migrations:migrate --no-interaction
fi fi
fi fi