Skip to content

Instantly share code, notes, and snippets.

@bguthrie
Created June 10, 2009 03:11
Show Gist options
  • Save bguthrie/126990 to your computer and use it in GitHub Desktop.
Save bguthrie/126990 to your computer and use it in GitHub Desktop.
# Give the stack a name, and describe its members.
stack = Awsymandias::EC2::ApplicationStack.new("test") do |s|
s.role "db", :instance_type => "m1.large", ...
s.role "app", :instance_type => "c1.xlarge", ...
end
# Check if we're running by pulling stack description from SDB; if not, launch asynchronously.
stack.launch unless stack.running?
until stack.running?
sleep(5)
end
# Capistrano
task :test do
set :db, stack.db.public_dns
set :app, stack.app.public_dns
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment