Using GIT to deploy website
I have followed this excellent write up
http://toroid.org/ams/git-website-howto to deploy code to my server using
Git's post-hooks strategy.
I have a post-update file that looks like this:
GIT_WORK_TREE=/home/rajat/webapps/<project name> git checkout -f
Everytime I push code to master branch, it gets auto deployed. What I want
to do now is to make this support multiple branches, so that:
git push origin master -----> deploys code to production
(/home/rajat/webapps/production)
git push origin staging ----> deploys code to staging
(/home/rajat/webapps/staging)
git push origin test ----> deploys code to test (/home/rajat/webapps/test)
For this, the post-update hook needs to understand which branch got
updated. Is this possible ?
No comments:
Post a Comment