Created
September 30, 2011 08:00
-
-
Save darkseed/1253036 to your computer and use it in GitHub Desktop.
puppet pre-receive hook
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/bash | |
while read old_sha1 new_sha1 refname anothervalue ; do | |
list=$(git show --pretty="format:" --name-only $new_sha1 | grep -e ".pp$") | |
for tmpfile in ${list}; do | |
git show ${new_sha1}:${tmpfile} | puppet --color=false --confdir=/tmp --vardir=/tmp --parseonly --ignoreimport | |
if [ "$?" -ne "0" ]; then exit 1; fi | |
done | |
done | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment