Skip to content

Workflows in Rails Development

by James Harrison on January 5th, 2009

What’s your workflow like for Rails development? For Nexus we’ve got a fairly good workflow set up, though we’re only using it with 2 developers. When I’m working on standalone projects (ISKsense, EVE Metrics, and other sites where there’s just me working on the code) then I use pretty much the same workflow. Here’s how it works.

Git (hosted at github.com) stores the project source code. For a given problem, I fork, make changes, merge back in, and push. That results in the Git repository on Github having the most up-to-date version on the ‘master’ branch.

At this point, CruiseControl.rb (A great continuous integration tool) picks up the update, and tries to run the full RSpec test suite on the project. Emails are sent out to all developers when the tests pass or fail, with associated error information if it’s the latter, as well as a HTML report on our CCrb instance.

Assuming we’re ready to deploy, I fire up Capistrano (an excellent pure-Ruby tool for deployment) on my development box, and run ‘cap deploy’. Capistrano connects to the server, makes a Git clone of the most recent master copy, copies in keys/database configs (So they’re kept out of Git), migrates the database, and then makes a symlink to the new project so Apache (running Passenger) is updated as to where it should be looking. And voila, we’re deployed!

I’d be interested to hear what workflows other people use for Rails development. This works fine, and Git means it scales fairly easily to accept more developers, as well as providing incredibly flexible distributed control (So I can work on my laptop away from the internet, committing, branching and so on as needed). But I’d be at a loss to make this work on a more complex deployment, say with EC2 or other virtualisation software. A continuous integration tool that played better with RSpec would be awesome, too.

From → Nexus, Programming

2 Comments
  1. I use a similar workflow. I have not had the opportunity to work with another developer. I live by git and github and I run all my tests locally and deply by doing a git clone on my prod server and running it through apache/passenger.

    I really am interested in trying out Capistrano sounds like a super easy way to get all the migrations and records.

  2. MaraRinn permalink

    What problems are you having with CruiseControl and Rspec?

    The workflow you’ve defined is pretty much “best practice” for Rails as far as I’m aware.

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS