Skip to content

Instantly share code, notes, and snippets.

@jonnypetraglia
Created March 19, 2014 05:15
Show Gist options
  • Save jonnypetraglia/9635817 to your computer and use it in GitHub Desktop.
Save jonnypetraglia/9635817 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment