Skip to content

Instantly share code, notes, and snippets.

@shavit
Created January 11, 2016 14:41
Show Gist options
  • Save shavit/b92010d9d3369de8be30 to your computer and use it in GitHub Desktop.
Save shavit/b92010d9d3369de8be30 to your computer and use it in GitHub Desktop.
Git deployment for Go Revel application
#!/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