Created
May 3, 2016 07:27
-
-
Save anhang/c177e377f044d1bb1c0fd678056224ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' ./ [email protected]:~/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