Dev Bootstrapping: ZB, Zillow’s Swiss Army Knife

Since the dawn of the shell scripting, developers have been using shell scripts and shortcuts to accomplish the quick, tedious things in everyday programming. Everything from starting a server, to creating a properly formatted diff, to navigating and searching directories are quick, small functions that can be encapsulated by shell scripts or functions.
The case was the same at Zillow. There’s no point spending time performing complicated, tedious workflows over and over again. So developers started writing scripts to make some of Zillow’s workflows easier.
Now developers’ workflows were faster, but there was only one problem. Developers were writing the same shell scripts over again! Without a central methodology to share these scripts, multiple developers would implement similar functionality in different ways, and without standard naming conventions, a developer couldn’t work quickly on another’s machine when doing something like pair programming or debugging a problem.
Our first attempt to resolve this was with a wiki page that had a giant list of shortcuts that developer can pick and choose to include:
However, this methodology was problematic as well:
These were minor problems, but they resulted in developer machines and the state between them being inconsistent, and useful commands not revealed or missing.
Enter sub. Sub solved a lot of the problems we were having:
So we promptly took the whole list of shell commands on the wiki page and converted them into sub commands. We modified the sub library to allow modification of environment variables in the current shell (something that we would like to contribute back into the main sub at some point), and pushed the whole finished set into a git repository. Oh, and we dubbed the command ‘zb’ (short for Zillow-Bootstrap):
In the beginning, we had 10 very simple commands. However, there’s a lot of complex workflows at Zillow that developers are happy to automate, and contribute those back when the mechanism is as easy as contributing to a git repository or starting a pull request. There’s too many commands to go over them all, but here’s some highlights:
Remember, these are five out of the 50 commands that are available in zb. Many developers use these and several other zb commands every day.
One of the interesting things about zb is the fact that contributions to zb directly over the half year since it’s been implemented has exceeded 40 commands from about 10 developers, while contributions to the wiki page over two years were roughly 20, mainly from two developers. It seems that when there’s a direct place to put commands that you know are being shared in a reproducible manner and the upgrade path is simple, that’s when collaboration starts to really skyrocket.
So what lessons have we learned? Well, a few:
You can find Zillow’s own branch of sub here: