Created
January 11, 2016 14:41
-
-
Save shavit/b92010d9d3369de8be30 to your computer and use it in GitHub Desktop.
Git deployment for Go Revel application
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/sh | |
# /<REPOS-PATH>/<REPO-NAME>.git/hooks/post-receive | |
APP_PATH=/<APP-PATH> | |
exit_with_error(){ | |
echo "---> An Error Has Occurred!" | |
} | |
echo "---> Receiving push as $USER" | |
git --work-tree=/<APP-PATH> --git-dir=/<REPOS-PATH>/<REPO-NAME>.git checkout -f | |
echo "---> Changing directory to the application path" | |
cd ${APP_PATH} | |
echo "---> Restarting" | |
exec restart <APP-NAME> | |
echo "---> Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment