Created
December 22, 2011 21:05
-
-
Save jperras/1511849 to your computer and use it in GitHub Desktop.
A git post-receive hook for making puppet suck less.
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 | |
echo "[NOTICE] *** Starting post-receive hook." | |
cd /etc/puppet | |
unset GIT_DIR | |
git fetch origin | |
if [ "$?" -ne "0" ]; then | |
echo "[FATAL] Could not fetch origin. Aborting." | |
exit $? | |
fi | |
git reset --hard HEAD | |
if [ "$?" -ne "0" ]; then | |
echo "[FATAL] Could not reset head. Aborting." | |
exit $? | |
fi | |
git push all master | |
if [ "$?" -ne "0" ]; then | |
echo "[FATAL] Could Push to all nodes. Aborting." | |
exit $? | |
fi | |
echo "[NOTICE] All relevant remotes have been updated." | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment