Skip to content

Commit

Permalink
Newest, working, tested version of puppetsubsync-hook.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Cooper authored and ramereth committed Sep 6, 2012
1 parent 781fe42 commit 59f753c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions hooks/puppetsubsync
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ SUBSYNC="ssh ${SSH_ARGS} "${PUPPETMASTER}" "${SYNC_COMMAND}""
while read oldrev newrev refname
do
BRANCH=`echo ${refname} | sed -n 's/^refs\/heads\///p'`
if [[ "${newrev}" -eq 0 ]]; then
if [[ "${newrev}" = "0000000000000000000000000000000000000000" ]]; then
# Delete the environment.
echo "Deleting environment."
${SUBSYNC} --deploy "${DEPLOY}" --branch "${BRANCH}" --delete
echo "Deleting environment. (${oldrev}, ${newrev}, ${refname})"
${SUBSYNC} --deploy "${DEPLOY}" --branch "${BRANCH}" --delete $@
elif echo ${BRANCH} | egrep '^t_' > /dev/null; then
# Make or update a test environment.
echo "Detecting leading t_ on branchname, cloning a testing environment."
${SUBSYNC} --branch "${BRANCH}" --repository "${REPO}" --deploy "${DEPLOY}" --test
${SUBSYNC} --branch "${BRANCH}" --remote "${REPO}" --deploy "${DEPLOY}" --test $@
else
# Make or update a standard environment.
echo "Cloning a standard environment."
${SUBSYNC} --branch "${BRANCH}" --repository "${REPO}" --deploy "${DEPLOY}"
${SUBSYNC} --branch "${BRANCH}" --remote "${REPO}" --deploy "${DEPLOY}" $@
fi
done

0 comments on commit 59f753c

Please sign in to comment.