Building a full-stack app with Golang and Google Cloud Platform in one week
GreenButton-201502
1. Recently, I was explaining continuous integration to my parents. My mother is a retired OB
Nurse who helped deliver hundreds of babies and my father is a retired broadcast engineer
who helped deliver tens of thousands of hours of television. Sometimes I like to explain things
to industry outsiders because it helps me solidify my own understanding of what exactly it is
that I do.
A lot of my clients use Amazon Web Services such as EC2, RDS, and Route53 to launch their
application, and a surprising number of them simply manage their instances from the Amazon
Web Site or even a mobile app. While these are the easiest ways do to it, it can be highly error
prone trying to remember which size instances need to be launched. In addition, there is a
great degree of tedium that is involved in building security groups, and determining what
ports to block.
Amazon has a great stack orchestration service called Cloudformation, that allows customers
to upload a properly formatted JSON (JavaScript Object Notation) file to the site, and AWS
will provision everything as described in the JSON. It’s a great way to build a VPC (Virtual Pri-
vate Cloud) quickly, and correctly every time.
Since the JSON file is an ASCII text file that is typically human edited, or perhaps generated
from some other application, it lends itself to fit nicely into source control systems such as
GitHub. Configuration artifacts can be checked out using git, modified with regular expres-
sions and deployed to Amazon using the command line API.
Initially I developed this as a Makefile, borrowing from decades of experience at the UNIX
command line, then I realized I had access to a powerful CI (Continuous Integration) system
known as Jenkins. Jenkins allows you to check out, build, and package releases and then add
WHAT DOES THIS GREEN BUTTON DO?
FEBRUARY 12, 2015 | JONATHAN | LEAVE A COMMENT
Jonathan Kalbfeld
What Does This Green Button Do? | Jonathan Kalbfeld http://jon.la/?p=62
1 of 2 2/15/15, 2:53 PM
2. any other desired post install tasks through a configurable interface.
After perfecting my JSON file for this particular client, I created a Jenkins project that checks
out the JSON file, manipulates the entries in it with sed (Stream editor) and launches a com-
plete stack, along with RDS instances, Route53 DNS configuration. This became the de facto
way for developers to launch practice environments. I even added a timeout that would auto-
matically terminate certain stacks after the end of the work day, like replicants from Blade
Runner, in essence saving money by turning off lights, or in this case, expensive AWS re-
sources.
This initial effort took about two weeks of my time to develop, and saved hundreds of hours al-
lowing developers to build and deploy their own environments, like Vagrant but on a much
larger scale and in about 17 minutes. All they had to do was click the green button.
That’s how continuous integration should be. It should be a moderate fixed cost effort, au-
tomating as much as possible, and then a low marginal cost effort. If it takes 15 minutes of a
developer’s time versus 2 weeks of a DevOps Engineer’s time, it’s a net savings of thousands
of dollars.
What Does This Green Button Do? | Jonathan Kalbfeld http://jon.la/?p=62
2 of 2 2/15/15, 2:53 PM