Created
December 21, 2012 02:38
-
-
Save ojacobson/4350323 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
repo puppet | |
config hooks.post-receive-command = "sudo pupdate -a" |
This file contains hidden or 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 -e | |
# If the repository has a 'hooks.post-receive-command' configuration item, | |
# run it as a tiny, tiny shell script. Otherwise, do nothing. | |
COMMAND="$(git config --local --get hooks.post-receive-command)" | |
if [ ! -z "$COMMAND" ]; then | |
bash -c "$COMMAND" | |
fi |
This file contains hidden or 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 -e | |
APPLY=no | |
while getopts ':a' opt; do | |
case $opt in | |
a) | |
APPLY=yes | |
;; | |
esac | |
done | |
shift $((OPTIND - 1)) | |
cd /etc/puppet/repository | |
git pull --ff-only | |
if [ "$APPLY" == yes ]; then | |
puppet agent --test | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment