Skip to content

Instantly share code, notes, and snippets.

@asalant
Created June 7, 2012 20:41
Show Gist options
  • Save asalant/2891426 to your computer and use it in GitHub Desktop.
Save asalant/2891426 to your computer and use it in GitHub Desktop.
Good Eggs dev workstation setup with chef soloist
# bash <(curl -s https://raw.github.com/gist/2891426)
read -p "Install Xcode (from the App store) and gcc for Lion (http://github.com/kennethreitz/osx-gcc-installer) and press enter to continue."
# setup your ssh keys for github
if ! [ -e "$HOME/.ssh/id_rsa.pub" ]
then
echo "Generating ssh key..."
read -p "Please enter the email you want to associate with your ssh key: " email
ssh-keygen -t rsa -C "$email"
fi
cat ~/.ssh/id_rsa.pub
cat ~/.ssh/id_rsa.pub | pbcopy
read -p $'\nYour ssh public key has been printed above and copied to the clipboard for convenience. Add it to your Github account at https://github.com/account/ssh and press enter to continue.'
# Install homebrew to get latest git. This way it still works if you did gcc, not just XCode (albeit this is irrelevant if you're installing e.g. Node.js, which requires headers from Xcode)
echo -e "\nRunning Homebrew installer.\n"
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
brew update
brew install git
# Chef the machine
git clone git@github.com:goodeggs/chef.git /tmp/bootstrap-chef-ops
rvm rvmrc trust /tmp/bootstrap-chef-ops
cd /tmp/bootstrap-chef-ops
# Main chef repo should have pivotal_workstation as a submodule, and a valid soloistrc file
git submodule update --init
sudo gem install bundler --no-ri --no-rdoc
bundle
echo -e "\nAbout to run Soloist, which requires root privileges (meaning you may be asked for your password)\n"
bin/soloist
rm -rf /tmp/bootstrap-chef-ops
cd -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment