Created
September 27, 2012 12:44
-
-
Save Granze/3793811 to your computer and use it in GitHub Desktop.
Automatic deploy based on git branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| while read oldrev newrev ref | |
| do | |
| branch=`echo $ref | cut -d/ -f3` | |
| if [ "master" == "$branch" ]; then | |
| git --work-tree=/var/www/prod checkout -f $branch | |
| echo 'Changes pushed live.' | |
| fi | |
| if [ "dev" == "$branch" ]; then | |
| git --work-tree=/var/www/dev checkout -f $branch | |
| echo 'Changes pushed to dev.' | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment