Skip to content

Instantly share code, notes, and snippets.

@simonmorley
Created August 29, 2013 00:02
Show Gist options
  • Save simonmorley/6372864 to your computer and use it in GitHub Desktop.
Save simonmorley/6372864 to your computer and use it in GitHub Desktop.
#!/bin/sh
USER=deploy
APP_ROOT="/var/www/html/deploy/production/current"
ENV=production
GEM_HOME="/home/deploy/.rvm/gems/ruby-2.0.0-p247"
UNICORN_OPTS="-c /config/unicorn_production.rb"
SET_PATH="cd $APP_ROOT; export GEM_HOME=$GEM_HOME"
CMD="$SET_PATH; $GEM_HOME/bin/unicorn $UNICORN_OPTS"
su - $USER -c "$CMD"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment