I have the following setup for my post commit hook:
in .git/hooks/push-to-staging
#!/bin/sh
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
git push -f myapp $branch:master && heroku run rake db:migrate -a my-app && heroku restart -a my-app
done
I made sure to chmod +x push-to-staging.
However, when I push to any of my branches, the push goes fine obviously ... but that's it. I don't see the push to my staging server happening.
Secondly, I'm wondering if there is a way to make this post commit hook a part of my repo (or is that not how hooks are supposed to work?). I just want everyone on my team to have this setup basically.