Created
February 19, 2017 20:24
-
-
Save drbyte/6e2b33a28f259259a49c80b941f35007 to your computer and use it in GitHub Desktop.
Envoyer deploy equiv by Tim Leland - inspired by https://gist.github.com/rap2hpoutre/95d51c8d3d82777cae14
This file contains hidden or 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