Skip to content

Instantly share code, notes, and snippets.

@deckool
Created February 14, 2015 10:42
Show Gist options
  • Save deckool/68f4f61d7cbcdfc7af5e to your computer and use it in GitHub Desktop.
Save deckool/68f4f61d7cbcdfc7af5e to your computer and use it in GitHub Desktop.
My hook
#!/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