Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

103 lines (63 sloc) 4.8 kB
h2. Capsize : The Capistrano Plugin for EC2
h2. → 'capsize'
h2. About
Amazon Web Services offers a compute power on demand capability known as the Elastic Compute Cloud (EC2). Using the current API's the compute resources in the cloud can be provisioned on demand by making SOAP or HTTP Query API calls to EC2.
<b>Legal Stuff : This project is in no way affiliated nor does it represent Amazon.com, Amazon Web Services, or the Amazon Web Services Elastic Compute Cloud service.</b>
This gem provides a plugin for the fantastic "Capistrano 2":http://www.capify.org/ deployment and server management tool written by Jamis Buck. With this gem, and Capistrano installed, you will be able to issue commands and script your interaction with Amazon's Elastic Compute Cloud (EC2) service. This gem depends on the installation of the newly updated "amazon-ec2":http://amazon-ec2.rubyforge.org/ Ruby Gem which is an interface library that can be used to interact with the Amazon EC2 system.
h2. Project Info
This project is managed as a RubyForge project which you can find at "http://capsize.rubyforge.org/":http://capsize.rubyforge.org/ and this is always the best place to find the latest news, report any bugs, submit feature requests, or provide patches.
h2. Documentation
You can browse the complete RDoc generated documentation at:
"http://capsize.rubyforge.org/rdoc/":http://capsize.rubyforge.org/rdoc/
h2. Installing
This gem follows the standard conventions for installation on any system with Ruby and RubyGems installed. If you have worked with gems before this will look very familiar.
h3. Installation pre-requisites
Before you can make use of this gem you will need an "Amazon Web Services developer account":https://aws-portal.amazon.com/gp/aws/developer/registration/index.html. This account must also be specifically enabled for Amazon EC2 usage. AWS will provide you with an 'AWS Access Key ID' and a 'Secret Access Key' which will allow you to authenticate any API calls you make and ensure correct billing to you for usage of the service. Take note of these (and keep them secret!).
h3. Installing the gem
<pre syntax="ruby">sudo gem install capsize</pre>
h2. Getting Started
In RAILS_ROOT:
<pre syntax="ruby">
capify
</pre>
Edit the file config/deploy.rb and find something like the following:
<pre syntax="ruby">
set :application, "foobar"
require 'capsize'
</pre>
IMPORTANT : Ensure that the "require 'capsize'" line comes AFTER the line in your configuration where you set your application name. Capsize will not work properly if this is not done!
Once the Capsize section of deploy.rb is just how you'd like it you should be able to run 'cap -T' to show all available Capistrano commands:
<pre syntax="ruby">
# cap -T
...
cap ec2:console:output # Show instance console output.
cap ec2:images:show # Describe machine images you...
cap ec2:instances:show # Info about your instances.
cap ec2:instances:reboot # Reboot an EC2 instance.
cap ec2:instances:run # Runs an instance of :image_...
cap ec2:instances:ssh # Open an SSH shell to instan...
cap ec2:instances:terminate # Terminate an EC2 instance.
cap ec2:keypairs:create # Create and store a new keyp...
cap ec2:keypairs:delete # Delete a keypair.
cap ec2:keypairs:show # Describes your keypairs.
cap ec2:security_groups:authorize_ingress # Authorize firewall ingress ...
cap ec2:security_groups:create # Create a security group.
cap ec2:security_groups:create_with_standard_ports # in deploy.
cap ec2:security_groups:delete # Delete a security group.
cap ec2:security_groups:revoke_ingress # Revoke firewall ingress for...
cap ec2:setup # Initialize the Capsize conf...
...
</pre>
You should now see a group of tasks that start in the namespace 'ec2:' similar to what you see above.
Finally, run the following Capsize command which will generate your initial Capsize config files and show you a help document that will take you through the remaining configuration steps and get you up and running with your first Capsize controlled EC2 instance.
<pre syntax="ruby">
cap ec2:setup
</pre>
Enjoy!
h3. Project Tools
"GitHub":http://github.com/jnewland/capsize
h3. Related Project Websites
"http://aws.amazon.com/":http://aws.amazon.com/
"http://amazon-ec2.rubyforge.org/":http://amazon-ec2.rubyforge.org/
"http://capsize.rubyforge.org/":http://capsize.rubyforge.org/
"Capistrano 2":http://www.capify.org/
Jump to Line
Something went wrong with that request. Please try again.