Created
August 19, 2013 18:02
-
-
Save cmgmyr/6272152 to your computer and use it in GitHub Desktop.
Laravel Git Deployment (multiple branches)
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
#!/bin/sh | |
# | |
# hook file name: post-update | |
echo | |
echo "**** Pulling changes into server [Hub's post-update hook]" | |
echo | |
case " $1 " in | |
*'refs/heads/develop'*) | |
cd /var/www/vhosts/domain.com/dev/ || exit | |
unset GIT_DIR | |
git pull hub develop | |
echo | |
echo "Develop was pulled" | |
echo | |
php artisan migrate --env=staging | |
;; | |
esac | |
case " $1 " in | |
*'refs/heads/master'*) | |
cd /var/www/vhosts/domain.com/httpdocs/ || exit | |
unset GIT_DIR | |
git pull hub master | |
echo | |
echo "Master was pulled" | |
echo | |
php artisan migrate --env=production | |
;; | |
esac | |
rm -f app/storage/cache/* | |
rm -f app/storage/views/* | |
chmod -R 777 app/storage | |
chmod -R 777 public/assets/uploads | |
exec git-update-server-info |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment