in Hardware, Information Technology, Workplace

Continuous Deployment with a $10 USB Button

IDream Cheeky USB pushbutton picture‘ve been very busy at my job in system operations over at SecondMarket, trying to get our infrastructure in shape for many changes coming down the pipe. On the business side, the JOBS Act passed by Congress back in April means that the ban on general solicitation of accredited investors is being lifted, and so we expect to be able to grow our client base as a result.

More clients means more features needed to cater to them. On the technology side we have been working hard to deliver small packages of features faster, rather than in one large biweekly release: in other words, continuous delivery. I’m looking forward to the day when we can finally hand over the keys to engineering & have developers deploy whenever they want, using our Jenkins continuous integration system. Operations people have no business being a roadblock to software developers who want to get features out the door as quickly as possible. As long as the code is of high quality and doesn’t crash the servers, I’m comfortable with whatever gets deployed into production. It also means that engineers are 100% responsible for both the success and failure of their code — a simultaneous carrot & stick towards increasing quality.

The whole discussion around push-button deploys has led us purchasing an actual USB pushbutton. Made by a company called Dream Cheeky, this button — admittedly a little more flimsy than it appears in the picture — ships with only a Windows driver. Fortunately, someone has written a RubyGem and a Mac driver to interface with it. We’re taking the next logical step and making it possible to deploy with literally a button push.

All that’s needed to have it do useful things is some wrapper code, in the form of a Ruby script that invokes the Gem. To get actual pushbutton deploys, we’re thinking of attaching it to our Jenkins Walldisplay computer, and running a Ruby script on it like this:

#!/usr/bin/env ruby

require 'dream_cheeky' do
  open do
    system 'say -v Vicki "System is armed!"'

  close do
    system 'say -v Vicki "System disarmed."'

  push do
    system 'say -v Vicki "Firing missiles!"'
    system 'java -jar jenkins-cli.jar -s
            -i id_pushbutton build Deploy-To-EC2'

Perhaps this is taking things a little far. On the other hand, the metaphor of driving your entire deployment with a $10 USB button is useful: it forces us to make the build pipeline bulletproof, and ensure that enough tests have been written to give everyone confidence in the code without manual regression testing. Are we there yet? No — but hopefully a cheap USB button will encourage us towards that goal.