Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
puppet pre-receive hook
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
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment