Skip to content

Instantly share code, notes, and snippets.

View jonnypetraglia's full-sized avatar

Jonny Petraglia jonnypetraglia

View GitHub Profile
@jonnypetraglia
jonnypetraglia / Rails App Updater
Created March 19, 2014 05:15
Good for scripting, like cron. Updates a rails app, then restarts it. (Note: probably good not to use this in production...)
set -e
set -v
git checkout .
git pull
bundle install
rake db:migrate:status | grep "^ down" || true
rake db:migrate
pgrep -c [r]uby && pkill -f ruby || true
rails s -d -p 80