Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 36 lines (29 sloc) 879 Bytes
##!/bin/sh
#
CWD=`pwd`
SUBMODULE=`basename $CWD | sed 's/\.git$//'`
GITUSER='git'
GITSERVER='git.yourdomain.com'
PUPPETSUPERPROJECT='puppet.git'
SSHKEY=''
PUPPETUSER='puppet'
PUPPETSERVER='geppetto.yourdomain.com'
REPO="$GITUSER@$GITSERVER:$PUPPETUSERPROJECT"
DEPLOY="/etc/puppet/environments"
SSH_ARGS="-i $SSHKYE"
PUPPETMASTER="$PUPPETUSER@PUPPETSERVER"
SYNC_COMMAND="/usr/local/bin/puppetsubsync"
while read oldrev newrev refname
do
BRANCH=`echo $refname | sed -n 's/^refs\/heads\///p'`
if echo $BRANCH | egrep '^s_' > /dev/null; then
echo "Detecting leading s_ on branchname, submodule cloning..."
[ "$newrev" -eq 0 ] 2> /dev/null && DELETE='--delete' || DELETE=''
ssh $SSH_ARGS "$PUPPETMASTER" "$SYNC_COMMAND" \
--branch "$BRANCH" \
--repository "$REPO" \
--deploy "$DEPLOY" \
--submodule "$SUBMODULE" \
$DELETE
fi
done
Jump to Line
Something went wrong with that request. Please try again.