How I update my blog app

Published: 2013-09-19
Tagged: rails

There's a few ways how to deploy a Rails application to production - I use the really basic one requiring me to do all the work by myself. Why? I feel that by doing the basic steps by myself, I get to commit what exactly happens to memory better.

  1. I start off with making all the required changes and testing them out on my local dev box and then pushing them to my blog's repo on github.

  2. I SSH into my DigitalOcean instance, stop nginx, and do a git pull. Yes, I know that this is a service interruption, however my blog doesn't get enough traffic to make me work on overcoming this, although I've got a few ideas.

  3. I backup my small database.

  4. Bundle install

  5. I run rake db:migrate RAILS_ENV='production'. This step usually catches quite a few errors so I fix them. In my recent update, it turned out that I didn't rename my migrations to how their classes were named.

  6. I run rake assets:precompile RAILS_ENV='production' to get my sweet new assets up.

  7. I start the nginx server.

  8. Checkout if I'm getting any errors, if yes then I cat logs/production.log and fix them.

Usually the whole process takes less than 10-15 minutes. Not too bad, but next time I want to checkout capistrano.

P.S Had a hiccups with this update - I overlooked testing a new application helper. Next project up is to get specs up an running to avoid these issues in the future. Btw, I know about the JS bug, I'll fix it right after I'm done with the qualification round for CSAW.

Here's the result of the recent update:

End of summer in the West Tatra mountain range.

Hi, I'm Matt.

This blog is an unordered set of thoughts extracted from the mind of a software developer.

About Me PGP key

Archives  Feed  The Photolog!  t: pr0tagon1st