Skip to content

Instantly share code, notes, and snippets.

@ojacobson
Created December 21, 2012 02:38
Show Gist options
  • Save ojacobson/4350323 to your computer and use it in GitHub Desktop.
Save ojacobson/4350323 to your computer and use it in GitHub Desktop.
repo puppet
config hooks.post-receive-command = "sudo pupdate -a"
#!/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
#!/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