Skip to content

Instantly share code, notes, and snippets.

@negatronGister
Created September 13, 2015 09:21
Show Gist options
  • Save negatronGister/471712a6563f7c6a2eff to your computer and use it in GitHub Desktop.
Save negatronGister/471712a6563f7c6a2eff to your computer and use it in GitHub Desktop.
Git post-receive hook for deploying on webfaction
# *** INSTRUCTIONS ********
# $ cd repo.git
# $ cat > hooks/post-receive
# paste this
# Ctrl+D
# chmod +x hooks/post-receive
# ***************************
#!/bin/sh
GIT_WORK_TREE=/home/USERNAME/webapps/APPNAME/app git checkout -f master
GIT_WORK_TREE=/home/USERNAME/webapps/APPNAME/app git reset --hard
/home/USERNAME/webapps/APPNAME/bin/stop
/home/USERNAME/webapps/APPNAME/bin/start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment