As a developer, the device I use for development is part of the development itself. I have things setup the way that I want them, and feel completely uncomfortable when forced to use someone else's device to do anything. Hot Corners, fonts, keyboard shortcuts. These all make my day to day development easier and more productive.
I currently use a Macbook Pro for my development machine, although I did just buy a Chromebook for another purpose (more on that to come in a future blog post). This isn't a post about how great apple Macbooks are. I mean, they last a long time, they don't suffer in the same ways laptops from other providers seem to, I like OSX etc. But all of that's personal opinion. What this post is about is Boxen. Never heard of Boxen? Well you're not alone; I hadn't until about a year ago.
Boxen
Boxen is basically automation for your Mac from GitHub. In Operations we have automation tools such as ansible, chef and puppet. Boxen is exactly that, but for your machine running OSX and it runs puppet underneath it, which means you can utilise puppet modules.
The key here is reproducibility; something we cry out for when building and deploying applications, but don't think twice about when it comes to the machines we develop on. After getting my Mac setup over the course of months, or maybe even years, to then have all that wiped away when you do a clean install or get a new mac isn't great. Yes, you can restore from say a Time Machine backup but that's not usually too helpful - usually we want a nice clean fresh install; Boxen fixes this for us.
Over the past month I've been building up a Boxen repo around other jobs, clients and the things that make money. I got to what I felt was a good point and decided to take the plunge. I was still running Yosemite and wanted to upgrade to El Capitan; something I hadn't done due to speaking at events and travelling - keynote not working properly or not being able to fix something for a client would have been catastrophic.
Yesterday, I formatted my Mac (3 times) and installed a fresh install of El Capitan. I installed Xcode, Xcode's command line tools and cloned down my Boxen repo from Bitbucket. I then ran Boxen and off it went installing all my apps and setting OSX defaults. Now, my repo isn't 100% perfect; it doesn't run successfully on the first go and will never run 100% any time after that due to a few issues. Here's three reasons why:
- I need my SSH key in Github and Bitbucket for it to access repos.
- Once I've installed something from the App Store, the script tries to find the word "install" every time after that, and it fails - because the app's already installed.
- Installing apps from
brew cask
sometimes requires passwords and Boxen can't deal with that; so you have to re-run these commands yourself.