Skip to content

Instantly share code, notes, and snippets.

@knzconnor
Created October 4, 2011 07:05
  • Star 1 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save knzconnor/1261054 to your computer and use it in GitHub Desktop.
An example bash bootstrap to get workstation set-up with chef - update YOUR_ORG below
#!/usr/bin/env sh
#After forking and editing YOUR_ORG to point at the right repo can be run via:
#bash <(curl -s https://raw.github.com/gist/THEIDOFYOURFORKEDGIST)
#if you use `curl xxx | sh` input will be messed up and there will be no pauses
#I keep XCode and gcc on a thumbdrive along with java, for speeding things up
#http://support.apple.com/downloads/DL1421/en_US/JavaForMacOSX10.7.dmg
read -p "Install XCode or gcc (http://github.com/kennethreitz/osx-gcc-installer)"
#setup your ssh keys for github
echo "Please enter your email: "
read email
ssh-keygen -t rsa -C "$email"
cat ~/.ssh/id_rsa.pub
cat ~/.ssh/id_rsa.pub | pbcopy
read -p "\n\nYour ssh public key has been copied to your clipboard. Add it to github and press any key to continue"
#install homebrew to get latest git. This way it still works if you did gcc, not just XCode
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
brew install git
#Do a tmp version of your chef recipes. If you you pivotal_workstation:git_projects, you'll end up with the final version in ~/workspace/chef-opts, if you add it to the list
#obviously edit the git path to be your workstation chef cookbook repo
#see https://github.com/cloud-city-development/ccd_workstation for some example recipes setup.
cd /tmp
git clone git@github.com:YOUR_ORG/chef-ops.git
cd chef-ops
#Your main chef repo should have pivotal and cdd_workstation as submodules and a valid soloistrc file
git submodule update --init
sudo gem install bundler
bundle install --binstubs
#https://github.com/mkocher/soloist is a thin wrapper for chef-solo that makes it easy to run and specify a list of recipes/
#Good for workstation usage
bin/soloist
#Make sure that bundler and the required gems are installed. May still need a bundle on next use from ~/workstation/chef-opts
bash .rvmrc
gem install bundler
bundle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment