Skip to content

Normal Deploy

Joe Cridge edited this page Apr 25, 2016 · 1 revision

Current deploy process. Some of it could probably be automated further with Capistrano.

On the development machine

  1. Make sure your private key has been added to the forwarding agent:

    $ ssh-add ~/.ssh/id_rsa
    

    You only need to do this if you have logged out of the development machine since the last time you used it.

  2. Let Capistrano do its thing:

    $ cap production deploy
    

    You need to be in the root directory of the app.

On the server

  1. Change to the app root directory:

    $ cd /apps/my_app/current
    

    You must cd like this with an absolute path every time you deploy. This is because /apps/my_app/current is a symlink rather than a real directory, and its target gets updated by Capistrano.

  2. Install new gems:

    $ bundle install
    

    Only necessary if you have added gems to your Gemfile.
    You may need to enter your user password.

  3. Migrate the database and precompile assets:

    $ RAILS_ENV=production rake db:migrate
    $ RAILS_ENV=production rake assets:precompile
    
  4. Reload unicorn:

    $ sudo service unicorn reload