-
-
Save KABBOUCHI/c512e2be0142357e06f8754ed6b2ce45 to your computer and use it in GitHub Desktop.
This was copied from https://medium.com/@timleland/zero-downtime-laravel-forge-deploys-6f1251559996#.m05tuzros
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stop script on error signal | |
set -e | |
# remove old deployment folders | |
if [ -d "/home/forge/weather-deploy" ]; then | |
rm -R /home/forge/weather-deploy | |
fi | |
if [ -d "/home/forge/weather-backup" ]; then | |
rm -R /home/forge/weather-backup | |
fi | |
cp -R /home/forge/weather.timleland.com /home/forge/weather-deploy | |
# Update | |
cd /home/forge/weather-deploy | |
git pull origin master | |
composer dump-autoload | |
composer install --no-interaction --prefer-dist --optimize-autoloader | |
php artisan cache:clear | |
php artisan route:cache | |
php artisan view:clear | |
php artisan migrate --force | |
php artisan opcache:clear | |
# Switch (downtime for microseconds) | |
mv /home/forge/weather.timleland.com /home/forge/weather-backup | |
mv /home/forge/weather-deploy /home/forge/weather.timleland.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment