Instantly share code, notes, and snippets.

Embed
What would you like to do?
from: http://blog.anhangzhu.com/2016/05/03/easy-rails-deployment-with-rsync/
First, have an rsync_exclude file:
// my-rails-app/.rsync_exclude
.bundle
tmp
log
Run in localhost:
$ bundle exec rake assets:precompile
$ rsync -a --delete --stats --progress --exclude-from='./.rsync_exclude' ./ your@domain.com:~/your-rails-folder/
Run in production server:
$ rvm use ruby-2.2.2
$ cd ~/your-rails-folder
$ bundle install --without development test
$ rake db:migrate RAILS_ENV="production"
// If needed:
$ RAILS_ENV=production bundle exec rake assets:precompile
Restart server:
$ killall -USR1 dispatch.fcgi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment