Push-button deployments with Arduino

TL;DR: Thanks to an Arduino, an Arduino ethernet shield, some Arduino code, buttons from eBay, LEDs from Fry’s, and SmugMug’s deployment web app, we’ve created a push-button deployment process that looks like this:

When I first started working at SmugMug, we deployed infrequently by manually merging branches, tagging, double-checking, then running a bunch of commands (some via sudo and some not). It was an eleven step process that not all developers had access to. Developers were usually uneasy about pushing due to the complexity involved.

Eventually the process was consolidated into a shell script, which still had to be run via sudo on a designated server. More recently, the shell script was wrapped in a web app that made things much easier.


While the web app is pretty awesome and easy to use, I thought using a real physical button to deploy code would be even better:

Introducing the SmugMug Deployinator 5000!


Deployinator 5000


Deployinator 5000 inside



Arduino and Ethernet Shield


The Deployinator 5000 consists of the following components:

The setup is relatively simple. The toggle switch, key lock, and two momentary switches are all wired up in sequence so the Arduino sees them as one button. When all four are pressed, the Arduino makes an HTTP POST request to our deployment server, which then pushes any pending code live. While the Arduino is waiting for the deployment to finish, it blinks the yellow LED. When the push is deployed, the green LED lights up. If something goes horribly wrong, the red LED strikes fear into the deployer’s heart.

It wasn’t too hard to wire up the Arduino, the buttons, and the LEDs, even for someone with no electronics experience (although I had a bit of help from other SmugMug employees with more experience). The fun and challenging part was finding an enclosure and mounting all the pieces inside it. Trips to Weird Stuff and Home Depot solved that problem easily!

After gutting the enclosure, I superglued the Arduino holder to the inside and drilled holes into the backing plate to mount the buttons with machine screws. I then reattached a few wires and circuitry for dramatic effect.

Long-term ideas for the Deployinator include adding larger lights, a disco ball, and playing music when a push occurs. PowerSwitch Tails would allow the Arduino to control anything that runs on 120V power.

Deploying code doesn’t have to be boring!

– Ryan Doherty, SmugMug DevOps

8 thoughts on “Push-button deployments with Arduino

  1. Ryan Grove January 30, 2013 / 2:30 pm

    @David: But this is the Deployinator _5000_! It’s, like, 5,000 times better than a plain old Deployinator. πŸ™‚

    But don’t worry, if SmugMug decides to start mass producing ridiculously awesome push-button deployment hardware, we’ll use a name that isn’t already taken.

  2. Jeff January 30, 2013 / 8:20 pm

    It desperately needs sounds added. Increasing intensity power-up sounds for power and prime, then something suitable for deploy and success/fail πŸ™‚


    • Ryan Doherty January 30, 2013 / 8:43 pm

      @Jeff: Definitely! I have a ton of ideas for how to improve it πŸ™‚

  3. Abraham February 1, 2013 / 2:11 pm

    Is this project open source? Any links to the Arduino and app code?

    • Ryan Doherty February 1, 2013 / 2:29 pm

      The Arduino wiring and code is pretty much identical to what you can find on the Arduino tutorials http://arduino.cc/en/Tutorial/HomePage . There’s button code and web client code, so just mash the two together and it will work πŸ™‚

      Our deployment app is a thin PHP app wrapped around a bash script wrapped around git, it’s pretty specific to our environment. If you want something premade and usable I recommend Etsy’s Deployinator : https://github.com/etsy/deployinator

  4. michael mitchell July 30, 2013 / 1:12 pm

    Will you be writing a blog post on developing the new SmugMug?

Comments are closed.