Skip to content

Commit

Permalink
Add hooktype. Now refs can be taken form args or from stdin.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav Bogatyrev committed Jul 25, 2012
1 parent cf30365 commit a6d071a
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions git-jekyll-clodo-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
# uploading them to CloudStorage.
################################################################################


DEBUG=no

# CloudStorage access credentials
Expand All @@ -26,13 +25,34 @@ DBRANCH="master"
# updel - Upload everything and then delete unnecessary objects form CS.
DMETH="updel"

# Hook type
# update - get refs from args
# recieve - get refs from stdin
HOOKTYPE="recieve"

################################################################################
# Don't edit anything below this line until you know what you are doing
################################################################################

if [[ "$*" =~ "refs/heads/${DBRANCH}" ]]; then
echo "We have update for $DBRANCH. Need to regenerate and deploy."
if [ "$HOOKTYPE" == "update" ]; then
if [[ "$*" =~ "refs/heads/${DBRANCH}" ]]; then
echo "We have update for $DBRANCH. Need to regenerate and deploy."
else
exit 0
fi
elif [ "$HOOKTYPE" == "recieve" ]; then
while read oldrev newrev ref
do
REFZ+=" $ref"
done

if [[ "$REFZ" =~ "refs/heads/${DBRANCH}" ]]; then
echo "We have update for $DBRANCH. Need to regenerate and deploy."
else
exit 0
fi
else
echo "Unknown hook type ${HOOKTYPE}."
exit 0
fi

Expand Down

0 comments on commit a6d071a

Please sign in to comment.