readthedocs.org/deploy
Eric Holscher 0cc034e611 Install numpy on the build server. Refs #236. 2012-11-27 10:16:56 -08:00
..
cookbooks/main Fixing the nginx config to fix issue #93 2011-08-22 18:07:34 -07:00
fab Install numpy on the build server. Refs #236. 2012-11-27 10:16:56 -08:00
production Fix CNAME index.html issue. >:x@regex 2012-08-31 12:37:51 -07:00
roles Add graphviz to the default packages. Closes #66. 2011-06-07 16:32:38 -07:00
README Added some more docs 2012-03-12 18:21:30 -07:00
Vagrantfile Cleaned up Vagrantfile, added more docs on deployment 2012-03-12 18:21:29 -07:00
fabfile.py Make sure to use the same version of chef as the vagrant 2012-03-12 22:01:23 -07:00
knife.rb Forgot to add the knife.rb file 2012-03-12 18:21:29 -07:00
node.json Lots of deployment changes. 2011-04-09 22:22:02 -07:00
solo.rb Added the chef configs used for the site. 2011-04-02 20:42:49 -07:00

README

This directory contains chef sources and a vagrant configuration file.

To run on Amazon EC2 

* Set up chef 
* Install ruby and rubygems (If not already installed)
* sudo gem install knife-ec2 chef 
 
mkdir ~/.chef 
cp knife.rb ~/.chef   # knife.rb is included in the directory where this README is

# setup your enviroment variables for your keys (in .profile or another file) 
export AWS_ACCESS_KEY_ID=XXXXXXXXXX
export AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXXX

# create a amazon ec2 key pair for "rtfd" and save it to ~/.ssh/rtfd.pem
knife ec2 server create -r 'role[webserver]' -I ami-7000f019 -f m1.small

# you can run this to get the servers you have running, as well as their ip addresses
knife ec2 server list

# set it as a variable so you can reuse it  
export RTFDHOST=X.X.X.X


# if you ever want to start over from scratch you can destroy the instance by doing 
knife ec2 delete i-xxxxxxx

# more work is needed for it to be integrated into knife 


# ssh to the machine 
ssh -i ~/.ssh/rtfd.pem ubuntu@$RTFDHOST
sudo su - 
edit .ssh/authorized_keys 

# remove section command="echo 'Please login as the ubuntu user rather than root user.';echo;sleep 10"
# so it starts with ssh-rsa
# This should be automated 


# if fabric is not installed you will need to do a 
pip install fabric 

# install chef on the ec2 server
fab install_chef -H $RTFDHOST -i ~/.ssh/rtfd.pem

# sync the chef scripts to the server 
# Make sure to have your key in ssh-agent for rsync to use 
eval `ssh-agent`
ssh-add ~/.ssh/rtfd.pem 
fab sync_config -H $RTFDHOST -i ~/.ssh/rtfd.pem

# sync and run chef on the ec2 instance
fab update -H $RTFDHOST -i ~/.ssh/rtfd.pem

 


To use Vagrant 

# get latest virtualbox if you don't already have it  
http://www.virtualbox.org/wiki/Downloads

# get the latest vagrant 
# install from downloads or from gem
http://downloads.vagrantup.com/

# To start, run 
vagrant up

# Once this is done 
vagrant ssh 
# to ssh into the machine 

# To destroy the box and start over again 
vagrant destroy