Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # File: GITOLITE_DIR/repositories/puppet.git/hooks/post-receive
- puppetsync()
- {
- ssh $SSH_ARGS "$PUPPETMASTER" "$SYNC_COMMAND" \
- --branch "$BRANCH" \
- --repository "$REPO" \
- --deploy "$DEPLOY" \
- $DELETE
- }
- set_common()
- {
- REPO="git@GITOLITE:puppet.git"
- SYNC_COMMAND="/usr/local/bin/puppetsync"
- SSH_ARGS="-i $HOME/git/.ssh/git@GITOLITE"
- }
- set_puppetmaster(){
- DEPLOY="/usr/local/etc/puppet/environments"
- PUPPETMASTER="puppet@PUPPETMASTER"
- }
- set_otherpuppetmaster(){
- DEPLOY="/usr/local/etc/puppet/environments"
- PUPPETMASTER="puppet@PUPPETMASTER"
- }
- set_commonwhile read oldrev newrev refname; do BRANCH=`echo $refname | sed -n 's/^refs\/heads\///p'`
- [ "$newrev" -eq 0 ] 2> /dev/null && DELETE='--delete' || DELETE=''
- set_puppetmaster; puppetsync
- #set_otherpuppetmaster; puppetsync
- done
Add Comment
Please, Sign In to add comment