Skip to content

Instantly share code, notes, and snippets.

@ajburton
Created June 13, 2011 17:23
Show Gist options
  • Save ajburton/1023239 to your computer and use it in GitHub Desktop.
Save ajburton/1023239 to your computer and use it in GitHub Desktop.
Sandbox quick start
## all Chef commands need to be run from the chef-repo directory; go there
cd chef-repo
## setup the AWS environment
source .chef/.awsrc
## add the developer ssh key to your keychain
ssh-add .chef/coshx-dev-keypair.pem
## create a node
knife ec2 server create -x ubuntu -G sandbox -r 'role[development]'
## tag the node (have to put your thinking cap on here)
export NODE=i-whatever
knife tag create $NODE MYSANDBOXNODE
## setup the SANDBOX_HOSTS environment variable
export $SANDBOX_HOSTS=$(knife search node "tags:MYSANDBOXNODE" -a ec2.public_ipv4 | grep ec2 | awk '{print $2}')
## setup the directories on the server, grab the code, setup the database
## and start the app server
cap sandbox deploy:setup
cap sandbox deploy:update
cap sandbox deploy:setup_images_symlink
cap sandbox deploy:migrate
cap sandbox deploy:seed
cap sandbox deploy:start
## browse to the public IP in your browser and use the server!
firefox $SANDBOX_HOSTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment