Skip to content

Instantly share code, notes, and snippets.

@zaherg
Created February 28, 2017 18:41
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save zaherg/e1492188a82847601f9d17748db80a4c to your computer and use it in GitHub Desktop.
Save zaherg/e1492188a82847601f9d17748db80a4c to your computer and use it in GitHub Desktop.
# 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