Skip to content

Instantly share code, notes, and snippets.

@pocesar
Forked from tlrobinson/post-receive
Created January 3, 2014 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pocesar/8236629 to your computer and use it in GitHub Desktop.
Save pocesar/8236629 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -u
set -e
export GIT_WORK_TREE="/var/www/example.com"
export NODE_VERSION="0.10"
echo "--> Checking out..."
git checkout -f
echo "--> Selecting Node version $NODE_VERSION"
. $HOME/.nvm/nvm.sh
nvm use $NODE_VERSION
echo "--> Installing libraries..."
cd "$GIT_WORK_TREE"
npm install
echo "--> Exporting Foreman files..."
node_modules/.bin/nf export -o /etc/init
echo "--> Restarting..."
stop foreman
start foreman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment