No commit activity in last 3 years
No release in over 3 years
Tired of changing dns names or ips in your deploy.rb? You found a solution! This gem uses EC2 tags in order to define servers in your deploy script. You can set project, environment and roles tags per instance to have total control.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.5
= 10.1.1

Runtime

= 2.7.11
 Project Readme

Cap::Aws::Ec2

Tired of setting hardcoded ips or dns names in your capistrano deploy script? You just found the solution!

cap-aws-ec2 will fetch instances from you EC2 region and define them by project, environment and roles.

This gem should be used in conjunction with capistrano multistage

Note: This gem is only compatibale with Capistrano 2.x

Installation

Add this line to your application's Gemfile:

gem 'cap-aws-ec2', require: false

And then execute:

$ bundle

Or install it yourself as:

$ gem install cap-aws-ec2

Usage

  1. Define tags for your servers on EC2:
Name Tag Project Tag Environment Tag Roles Tag Public IP
ftbpro-web1 ftbpro-web production app,web 1.1.1.1
ftbpro-web2 ftbpro-web production app,web 2.2.2.2
ftbpro-resque ftbpro-web production app,resque 3.3.3.3
  1. In your deploy.rb script:
require 'cap-aws-ec2'
set :aws_key_id, 'XXXXXXXXXXXXXX'
set :secret_access_key, 'XXXXXXXXXXXXXXXXXXXX'
set :aws_region, 'us-west-2' 
set :ec2_project, 'my-project-tag-value'
set(:ec2_env) { stage }
  1. In your corresponding stage file (config/deploy/production.rb):
define_servers

This will result in the following statements:

server 1.1.1.1, :app, :web
server 2.2.2.2, :app, :web
server 3.3.3.3, :app, :resque

Contributing

  1. Fork it ( http://github.com//cap-aws-ec2/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request