Ruby and Rails Development Environment Using Chef and Vagrant26 Dec 2014
TL:DR We created a Vagrant+Chef cookbooks combination for provisioning a new laptop for Ruby/Rails development. Fork it here gogobot/devbox.
Our development environment at Gogobot grew a lot over the last 4 years, from a simple rails application reading/writing from a mySQL DB into a full blown application that has many dependencies/micro-services and messaging between different kind of apps.
Over the last 4 years, we had multiple ways for installing the application, when I joined Gogobot it was a Google doc with about 8 pages filled with
sudo gem install and multiple configuration that I had to do manually, it took me about 2 days to get everything installed and running.
After a while it became better and we released gogobot/laptop, which was a bit better, but it had many many issues, if one of the processes would fail, you had to start all over and it was very unfriendly, when I installed my new laptop 3 years ago using this script it took a full day to get everything installed and running.
Even today, think about your development environment, you have so many things you did manually
- tmux config
- vim config
- SSH keys
- Adding SSH known hosts
- Cloning the repo
- Running bundle
- Configuring mysql client
- Configuring postgres client
All of these steps live somewhere, usually in some abandoned corner of your brain, you might choose to
brew update git or run a newer version of Redis while another member of your team still runs an older version.
We decided it’s not good enough for us anymore and we set out to do it differently.
Going into this, we had a few goals in mind
- Use existing tools already used at Gogobot
- Simple to install/use/understand for any team member (Ruby Engineers / iOS / Android / Project,Content,Product people)
- Minimal dependencies on host machines (git, Vagrant, Virtualbox)
- Easy to re-configure and re-provision
- All engineers use the same packages
- Absolutely no manual configuration of environments
The finished solution
If you read posts on my blog before, you know we use chef quite extensively at Gogobot, we decided to use chef for this project as well, virtualizing with Vagrant and Virtual box.
Redacted (but fully working) version of the project is now at gogobot/devbox.
Please feel free to open issues/comment if you are using it or having issues with it.
Discuss on HackerNews here: https://news.ycombinator.com/item?id=8800108