Skip to content

Instantly share code, notes, and snippets.

@mrmorris
Created June 20, 2015 14:08
Show Gist options
  • Save mrmorris/3e1c5087ed52303a9ea6 to your computer and use it in GitHub Desktop.
Save mrmorris/3e1c5087ed52303a9ea6 to your computer and use it in GitHub Desktop.
Dummy pore-receive hook
#!/bin/bash
# For each ref being updated
# If it is master (branch)
# Then... update our server?
while read oldrev newrev ref
do
if [[ $ref =~ .*/master$ ]];
then
# this will echo back to the client
echo "Master triggered a deploy"
# this will write locally
echo "Deployed $newrev on $ref" > deploy.log
else
#this will echo back to the client
echo "Ref $ref received. Doing nothing. Only master will trigger and update."
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment