Home > DevOps > Push-button deployments with Arduino

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.

Pushit

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!

Front

Deployinator 5000

Inside

Deployinator 5000 inside

Buttons

Buttons

Arduino and Ethernet Shield

Arduino

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

Categories: DevOps Tags: ,
  1. January 30, 2013 at 12:46 pm

    Very cool but Deployinator is actually the name of an open source project, created by the Etsy team, to deploy code. https://github.com/etsy/deployinator

  2. January 30, 2013 at 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.

  3. Jeff
    January 30, 2013 at 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 :)

    Cool.

    • January 30, 2013 at 8:43 pm

      @Jeff: Definitely! I have a ton of ideas for how to improve it :)

  4. February 1, 2013 at 2:11 pm

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

    • February 1, 2013 at 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

  5. michael mitchell
    July 30, 2013 at 1:12 pm

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

  1. January 31, 2013 at 11:55 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: