Whenever I deploy using Forge, if I visit the page mid deployment I get the error screen
Parse error: syntax error, unexpected '\Foundatio', expecting \\ (T_NS_SEPARATOR) or ';' or '{' in /home/forge/develop.xxxxxxxx.ca/bootstrap/cache/compiled.php on line 1986
This only happens for a few seconds. However I was hoping there is a way to instead display a more friendly message indicating we ate down for maintenance or whatever.
You need to php artisan down before deploy and php artisan up after deploying. This way your application will be offline for a small amount of time. I believe it gives you a 503 error, so you can create a page for that as well ;)
Hey I thought I would also follow up here. It strange but I get my custom 503 page now that I am doing php artisan down first. However if I hit refresh over and over occasionally I still get the error screenshotted above. Here is my deploy script.
cd /home/forge/default
php artisan down
git pull origin develop
composer install --no-interaction --no-dev --prefer-dist
php artisan migrate --force
php artisan cache:clear
php artisan up
Is there an ordering problemo?
Also I have removed any blade directives and php code from 503.php file since the site is down (I think that makes sense?)
This looks fine for deployment. I think you just overload the server, not sure though. If you just use a clear message on the 503 page that the site will be back in a few minutes and you should be good to go ;)