Skip to content

Instantly share code, notes, and snippets.

@michal
Created February 19, 2013 12:55
Show Gist options
  • Save michal/4985632 to your computer and use it in GitHub Desktop.
Save michal/4985632 to your computer and use it in GitHub Desktop.
#!/bin/bash
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`
if [ "master" == "$branch" ]; then
git --work-tree=/home/huncwot/domains/reserved-ecomerce-master/current checkout -f $branch
package="/home/huncwot/domains/reserved-ecomerce-master/current/packages/${newrev}.zip"
git archive --format=zip HEAD skin templates > $package
target="/home/huncwot/domains/reserved-ecomerce-master/current/packages/${newrev}-${oldrev}.txt"
git diff $oldrev $newrev -- templates > $target
echo "Changes pushed to ${branch}"
fi
if [ "staging" == "$branch" ]; then
git --work-tree=/home/huncwot/domains/reserved-ecomerce-master/staging checkout -f $branch
echo "Changes pushed to ${branch}"
fi
if [ "feature" == "$branch" ]; then
git --work-tree=/home/huncwot/domains/reserved-ecomerce-master/feature checkout -f $branch
echo "Changes pushed to ${branch}"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment