Created
October 22, 2012 09:52
-
-
Save rpetre/3930697 to your computer and use it in GitHub Desktop.
post-receive hook for cfengine deployment
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 [ "prod" == "$branch" ]; then | |
| git --work-tree=/var/cfengine/masterfiles checkout -f $branch | |
| echo 'Changes pushed live.' | |
| fi | |
| if [ "test" == "$branch" ]; then | |
| git --work-tree=/var/cfengine/testfiles checkout -f $branch | |
| echo 'Changes pushed to test.' | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment