Boxcar Conductor: Rails deployment made easy
In a previous post, I showed how we’ve been working on an interactive deployment process for Rails applications to reduce the time it takes to deploy to a Boxcar.
We began to move our Boxcar deployment recipes into it’s own Rails plugin and just made it available on GitHub.
Introducing Boxcar Conductor
The Boxcar Conductor plugin aims to automate the entire process for deploying to your Boxcar. We’re down to just a few simple commands to run to get your application up and running. While mileage may vary with other hosting providers, we did want to open up this work to the community and centralize our work with the community of Boxcar customers who have helped us build and test these tools.
Install Boxcar Conductor
If you’re running on Edge Rails… you can take advantage of the new support for installing plugins in git repositories.
$ ./script/plugin install git://github.com/robbyrussell/boxcar-conductor.git
note: If you’re not using edge rails, you can download a tarball and install the plugin manually.
Installing the plugin will add a custom Capfile and config/deploy.rb, which has a few things for you to define based on your Boxcar subscription.
Configure Your Boxcar
Once the plugin is installed, you can run the following task:
$ cap boxcar:config
This will ask you a few questions about your deployment needs.
- Which database server will you be using? (along with db user/pass info)
- How many mongrels should run in your cluster?
After a few quick multiple choice answers, you’re application is ready to be deployed and you can run an Boxcar-specific deployment task.
$ cap deploy
We’ve also created a new public project on Lighthouse so that you can submit tickets and ideas to us. With Boxcar, we’re really aiming to remove as many steps from the deployment process that aren’t necessary.
To follow along, visit the project on lighthouse or GitHub.
If you’re interested in learning more about Rails Boxcar, feel free to drop us a line.
Related Posts
Announcing Cobalt and monthly subscriptions for Boxcar 2
We’ve been designing and developing a new centralized billing platform over the past few months and late last week, we launched it! Along with this new billing platform, we launched another new application, Cobalt, which is a new account management and support tool for our hosting customers.
We’ll be migrating all of our past customers over to this new system in time, but are initially using it for new Boxcar customers.

We’ve been building the new system to use Braintree as our new credit card payment gateway. With this switch, we’re also introducing monthly subscription rates for Boxcar, which means that you can try it out month-to-month now.
Over the next few weeks/months, we’ll be announcing several features to Cobalt that will ease your Rails deployment experience.
I want to thank all those on my team that helped get these new applications up and running.
If you’re looking for professional VPS-based Rails hosting, hop on our train by ordering a Boxcar today for $99/month!
For more information, visit railsboxcar.com or Planet Argon.
Also, be sure to follow Boxcar on twitter.
Portland is calling... (you)
We’re not looking for rock stars or ninjas at Planet Argon. ;-)
We’re looking for individuals that share our core values.
- COLLABORATION – We believe that an open dialogue between all members of a group helps to produce more reasoned and intelligent decisions.
- ENTHUSIASM – We recognize the unique power of people who are passionate about their craft. We believe that fun is an essential ingredient in a collaborative and vibrant company culture. We think happy people make better software.
- COMMUNITY – We are part of many communities. Our neighborhoods, our cities, our workplace, and our professional communities. We give back to our communities by implementing socially responsible business practices and sharing our knowledge and tools with our peers.
- VERSATILITY – We believe that it is important for our team to be open and flexible, as well as the work that we do. This allows us to adapt to change and encourage innovation.
- EXECUTION – We value action and when people make things happen. It is important that we follow through on our commitments, plans, and ideas.
..maybe you’re a .NET/Java/PHP/Python developer (who secretly plays with Ruby on Rails at night/weekends). We’re looking for an intermediate-level Rails developer to join our team. Ideal candidates would be in the Portland, Oregon area or willing to relocate.
If you’re interested, take a moment and introduce yourself.
git-svn is a gateway drug 6
As we’re migrating away from Subversion to Git, I’m having to learn a lot about git-svn. Andy has posted a few articles on this topic, but I wanted to share a quick tip that I find myself forgetting.
Working with Subversion branches
While you’re hopefully already familiar with how great local branches are with Git, you might not know that you can connect local branches to remote branches in your Subversion repository. This allows those of us who are using Git locally to work against Subversion branches.
I’m going to assume the following:
- Your team is using Subversion
- Your team already has a branch that you’re working in
- Your team is following Subversion directory conventions (
branches/,tags/, andtrunk/) - You have Git installed (with SVN extensions)
Checkout the Subversion project with Git
Please visit Andy’s tutorial, Git SVN Workflow, for a more detailed explanation of the following commands.
First, we’ll initialize your new local Git repository with git-svn.
git svn init -s http://svn.yourdomain.com/repos/project_name
Now, you’ll change directories to your new Git repository.
cd project_name
Let’s fetch all previous revisions into your local repository1.
git svn fetch
Great, once this is done… you’re master (local) branch is linked to trunk/.
Mapping a local repository to a remote branch
Assuming that your team is working in a Subversion branch on the current iteration of work. Our team has a naming convention for branches for each iteration. For example, if we’re in Iteration 18, we’ll write this as ITER-018 everywhere (Basecamp, Lighthouse, Subversion, etc…). At the start of each iteration, we create a new branch with this naming convention.
For ITER-018, the Subversion branch would be located at:
- http://svn.yourdomain.com/repos/project_name/branches/ITER-018
If you were to do a git branch -r, you should see ITER-018 show up in the list. Now, the one thing that wasn’t clear when I first read the git-svn documentation was that you can’t just checkout that branch with one command. In fact, this has tripped me up a few times.
First, you’ll need to checkout a new local branch. I’ve opted to come up with my own convention for local branches and in this case, I’ll name it iter_018.
git co -b iter_018
So, now I’m in the iter_018 branch, which is local. I’m currently still mapped to trunk/, which isn’t what we want. However, all we need to do is reset where Git is currently pointed to. We can run git reset to point this to the ITER-018 branch.
git reset --hard ITER-018
That’s it! Now, the local iter_018 branch will point to branches/ITER-018 in your Subversion repository. This will allow you to work with your existing repository branch and still reap the benefits of local Git repositories.
What about master?
Good question. The git reset command that you ran will ONLY apply that that individual local branch. So, master is still pointing to trunk/. This will allow you to have several local branches that map to remote branches.
Next Steps…
If you’re working with Git already.. great!
If you’re working in an environment that using Subversion, git svn provides you the ability to start exploring Git without making your entire team switchover. Perhaps your a consultant and working for a client that uses Subversion… no problem!
We’re still using Subversion for past client projects and are considering GitHub, which just launched (to the public) today for future projects. A few of us are already using GitHub for open source projects.
Fun.. I just saw the following tweet pass by as I began to wrap up this post.
The Gateway Drug… Git reminds me of Cake
Questions?
I know that I glossed over a few things, so feel free to post questions and/or tips for others who are looking to dabble with Git.
1 You’ll likely have problems if you don’t have a Git authors file specified in your git config.
I am forking Rails 2
...well, creating a fork on GitHub. ;-)
It appears that Rails is moving from Subversion to Git!
Courtenay posted this a little while ago.
git clone git://github.com/rails/rails.git
Check it out the Ruby on Rails project on GitHub.
Start working on your next patch with git…
git clone git://github.com/rails/rails.git
cd rails
git br -a
git br my_patch
git co my_patch
This is cool news. :-)
Tip: Link to Unimplemented 13
Throughout our design and development process, we’re working around areas of the site that are not yet implemented but we also want to be able to allow our clients to demo their application. In an effort to manage their expectations, we need to be careful about what we link to. If a page/widget isn’t ready to be demo’d yet, we should avoid providing pathways to get interact with or navigate there. However, when we’re implementing HTML/CSS for pages, it’s sometimes makes sense to not hide certain things on the screen.
For example, let’s suppose that you’re working on the primary navigation of an application. You know what the other sections are going to be, but you’ve only implemented a few of them so far. Your HTML/CSS person is working on the design for the navigation and wants to have them be proper links… even to pages that don’t yet exist.
One option, which is quite common, is to provide a link with href="#". This works to some extent, but when people click on things, they naturally expect something to happen in response.
This approach doesn’t mesh well with our team as we don’t really want to field any questions like, “the navigation links are all broken. Nothing happens!”
So, a pattern that we’ve been using for a while is to trigger a javascript alert for every link within an implemented area that is linking to something that isn’t yet implemented.
Let’s take a really basic javascript function like:
# public/javascripts/application.js
function unimplemented() {
alert("NOTICE\n\nThis feature is not implemented yet. Please check back again soon!");
}
This allows us to do the following:
<a href="javascript:unimplemented();">link text</a>
When someone clicks the link, they’ll see a typical javascript alert message. This informs our clients/beta testers that we’re paying attention to what works and what doesn’t.
Let’s take it a step further and push this into a view helper.
# app/helpers/application_helper.rb
def link_to_unimplemented( link_text, *args )
link_to_function( link_text, 'unimplemented()', *args)
end
Now, we’re able to use link_to_unimplemented and pass any arguments that you’d pass to the default link_to view helper.
<%= link_to_unimplemented( 'link text', { :class => 'link_class_name' } ) -%>
Now our web designers can go about their work and use this helper as necessary.
An nice benefit for doing this is that we have a pattern that we follow so that we can rely upon to make sure that we don’t forget anything. This is the equivalent of adding @TODO@s throughout our code base.
If we search through app/views for ‘link_to_unimplemented’ we should be able to prevent missing any broken links. In the next screenshot, I’m using grep with colorized matches.
As you can see, we have something left to implement in that area of the application. :-)
This has been one of those lightweight patterns that we’ve been able to adopt and it’s definitely helped manage the expectations of our clients throughout our development process.
I’d love to hear your thoughts on this. How does your team handle things like this?











