public
Created

puppet pre-receive hook

  • Download Gist
pre-receive
Shell
1 2 3 4 5 6 7 8 9 10 11
#!/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 $?

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.