wip
This commit is contained in:
+16
-7
@@ -41,16 +41,25 @@ echo -e "\n====================== Running migrations... ======================
|
|||||||
run_migrations() {
|
run_migrations() {
|
||||||
/usr/local/bin/php /var/www/app/artisan migrate --force
|
/usr/local/bin/php /var/www/app/artisan migrate --force
|
||||||
}
|
}
|
||||||
RETRIES=30
|
RETRIES=10
|
||||||
DELAY=5
|
DELAY=5
|
||||||
until run_migrations; do
|
until run_migrations; do
|
||||||
RETRIES=$((RETRIES-1))
|
EXIT_STATUS=$?
|
||||||
if [ $RETRIES -le 0 ]; then
|
|
||||||
echo " > Database is not ready after multiple attempts. Exiting..."
|
if [ $EXIT_STATUS -ne 0 ]; then
|
||||||
exit 1
|
|
||||||
|
RETRIES=$((RETRIES-1))
|
||||||
|
if [ $RETRIES -le 0 ]; then
|
||||||
|
echo " > Database is not ready after $RETRIES attempts. Exiting..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo " > Waiting for database to be ready... retrying in $DELAY seconds."
|
||||||
|
sleep $DELAY
|
||||||
|
else
|
||||||
|
# If migration was successful, break out of the loop
|
||||||
|
echo " > Migration succeeded."
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
echo " > Waiting for database to be ready... retrying in $DELAY seconds."
|
|
||||||
sleep $DELAY
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo -e "\n====================== Spinning up Supervisor daemon... ====================== "
|
echo -e "\n====================== Spinning up Supervisor daemon... ====================== "
|
||||||
|
|||||||
Reference in New Issue
Block a user