Deploy Feature Branches to Heroku with Heroku Feature Deployments Gem

The Short Version

Deploy the branch you are currently on to Heroku, create a Pull Request, configure DNS and report in PivotalTracker with my Heroku Feature Deployments gem using the following command.

rake hfd:deploy

And tear everything down again with:

rake hfd:undeploy

The Long Version

The problem

I often find that one major bottleneck in the process of building and shipping software is testing features. Perhaps 1 feature is pushed to the staging server for testing, and the feature owner is working with the developer to iron out any kinks. While this is happening no other developers can push to staging. Perhaps the other developers don’t realise this, and keep pushing and wiping out each others work before it can be tested. The more things that are being worked on at once, the worse the problem can get.

The (temporary) solution

When we developers use git we create a feature branch where all of our changes go, then create a pull request in GitHub, and then it is merged in after a code review. Why not also use feature deployments? Heroku is perfect for quickly deploying temporary sites as long as your infrastructure is immutable.

My idea for a process is this:

The only issue with this really is that no-one wants to spend so much time creating Heroku apps, configuring DNS, etc.

In order to automate this we’ve been using a very simple gem which I hacked together in a couple of hours and have been gradually adding stuff to for the past year. This gem will handle the following functionality:

Deploying

All handled by 1 rake task:

rake hfd:deploy

Tearing Down

rake hfd:undeploy

This process has worked very well for us so far. The reason it’s a temporary solution is that the gem right now sucks. It’s does not have automated tests and it’s tied to Heroku/DNSimple/PivotalTracker. I’m going to start working soon on a hosted configurable deployment tool which integrates with many other services and has an API so that deployments may be started by a CampFire/HipChat/IRC bot.

Need some extra development power?

I don't have a lot of time at the moment, but I'm always interested to hear about new projects. I'm particularly interested in EmberJS/Elixir projects and refactoring Rails monoliths. Drop me a line at hello [at] mattbeedle [dot] name or using my contact form http://www.mattbeedle.name/#page-contact.

Hire Me


comments powered by Disqus
comments powered by Disqus