Created
August 18, 2013 19:09
-
-
Save jarohen/6263386 to your computer and use it in GitHub Desktop.
example git deploy post-receive hook
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
| read oldrev newrev refname | |
| worktree="/usr/local/lib/my-app/src" | |
| if [ "refs/heads/deploy" = "$refname" ] ; then | |
| echo "Pushing changes live:" ; | |
| sudo service my-app stop > /dev/null; | |
| git --work-tree="$worktree" checkout $newrev > /dev/null; | |
| sudo service my-app start; | |
| echo "Deployed!" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment