Created
November 2, 2011 13:11
-
-
Save jandudulski/1333581 to your computer and use it in GitHub Desktop.
post-update hook which deploy on server when pushed changes to live branch
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
#!/bin/sh | |
branch=$(git rev-parse --symbolic --abbrev-ref $1) | |
if [ $branch == "live" ] | |
then | |
echo | |
echo "**** Pulling changes into live server ****" | |
echo | |
cd /var/www/www.example.com || exit | |
unset GIT_DIR | |
git pull origin live | |
echo | |
echo "**** Reloading Apache ****" | |
echo | |
sudo /etc/init.d/apache2 reload | |
exec git-update-server-info | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment