How I update my blog app
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.
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.
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.
I backup my small database.
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.
rake assets:precompile RAILS_ENV='production'to get my sweet new assets up.
I start the nginx server.
Checkout if I'm getting any errors, if yes then I
cat logs/production.logand 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.