Created
February 14, 2015 10:42
-
-
Save deckool/68f4f61d7cbcdfc7af5e to your computer and use it in GitHub Desktop.
My hook
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/bash | |
while read oldrev newrev ref | |
do | |
echo "new: $newrev" | |
git show --pretty=format:"The author of %h was %an, %ar%nThe title was >>%s<<%n" | |
if [[ $ref =~ .*/master$ ]]; | |
then | |
echo "Master $ref received. Deploying master branch to production..." | |
GIT_WORK_TREE=~/tap git checkout -f | |
echo "$?" | |
else | |
echo "Ref $ref successfully received. Doing nothing: only the master branch may be deployed on this server." | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment