public
Last active

Bootstrap script for Mac dev machine setup

  • Download Gist
bootstrap.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
# bash <(curl -s https://raw.github.com/gist/1454081)
 
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 "$(curl -fsSL https://raw.github.com/gist/323731)"
brew install git
 
# Chef the machine
git clone git@github.com:brokenladder/chef-ops.git /tmp/bootstrap-chef-ops
rvm rvmrc trust /tmp/bootstrap-chef-ops
cd /tmp/bootstrap-chef-ops
 
#Your 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 -

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.