A few weeks ago Github released Boxen, a “tool for automating and managing Macs at GitHub”. At Mynewsdesk, with more than ten developers and a handful of projects, we can see the need for this kind of software. When summed up, many days have been spent trying to get developer laptops back in a working state for one reason or the other. We also had a lot of smart configurations, custom hacks, different versions of databases, sometimes shared with some collegues but without a central repository of collaboration for this kind of configurations.
At Mynewsdesk we’re using Chef for setting up and configuring our server environment. Boxen didn’t feel like a perfect fit for us, since it’s based on Puppet. Puppet and Chef are the two main competitors in this area of operating system configuration management.
To solve this we’re now presenting Chefup. The pipe dream of Chefup (and Boxen) is to be able to install a full developer machine with a single command. But more than that it also provides a way of keeping the machine in a working state, with all key components fully documented. As a bonus this can all be done without running sudo and wreak havoc with your system. Some cookbooks may themselves run sudo though, such as homebrew and pow.
Initial Setup
Firstly, this is still beta software! Please make a backup of your machine before running it and be prepared for massive losses of data, corrupted files and possibly the plague. Report any bugs to The Chefup Issue Tracker.
- To begin with, clone our open source project from Github;
git clone git://github.com/mynewsdesk/chefup.gitIf you still don’t have git installed you may want to
curlit instead;curl -L https://github.com/mynewsdesk/chefup/tarball|tar xzThat will get you a version without the
.gitdirectory but you can make a proper clone later on, when you have access to git. - To be able to compile you also need to install XCode from App Store.You’ll need to agree to the license by running;
xcodebuild -license - Now create a
Cheffile. That’s a list of external Chef cookbooks to be installed.cp Cheffile.example CheffileIf you work at Mynewsdesk and have access to our private repos you may uncomment the
chef-mynewsdeskrepo to setup our apps. - After this you want to decide exactly what Chefup will install for you. This is done in the
node.jsonfile. An example is provided for you so you want to begin with copying it.cp node.json.example node.jsonNow have a look at that file. In the header you enter your personal data in form of name and email. Then you choose where you want to keep your code, where the default is
~/dev.After that have a look at the run list. That’s a list of packages, or cookbooks in Chef terminology.
- Now, logged in as your normal user, run;
bin/chefupThis will install the
bundlerandlibrarian-chefgems, thehomebrewanddmgcookbooks and any cookbooks listed in the run list innode.json. If you havechefup-binin your run list you will have chefup in your $PATH after the first run, so it will be enough to just runchefup.Any backups of overwritten files are kept in
tmp/backup. Any installed apps (with an .app suffix) will be installed in~/Applicationsto avoid needing root permissions.
Living with Chefup
After the installation it is safe and even encouraged to run chefup as often as you want. It will then overwrite any changes you made to the Chefup controlled files. Therefore, if you install for example the bash cookbook you will not want to edit ~/.bashrc manually any more. Custom changes will instead be put in ~/.rc.d/. More information may be found in the README.md of the respective cookbooks under site-cookbooks, such as chefup/site-cookbooks/bash/README.md.
If you miss something, feel free to add a cookbook. Either as a new git repo and adding it to Cheffile. It will then be installed to cookbooks in the next run. Or by cloning the chefup-repo, adding cookbooks to site-cookbooks. Then please feel free to send a pull request to have it added to the official repo, if it could be of use to others.







Subscribe