Elbow is a Capistrano plugin for deploying to an AWS Elastic Load Balancer (ELB)
In the cloud, your web instances are forever changing. This Gem allows you to define in your cap file that a host is using an ELB and it will detect the EC2 instances and deploy your app to each of them.
** Version 0.0.4 and above support Capistrano 3 **
Add this line to your application's Gemfile:
gem 'elbow'
And then execute:
$ bundle
Or install it yourself as:
$ gem install elbow
In your config/deploy/yourstage.rb
require 'elbow/capistrano'
Important if you are using Capistrano version 2 then:
require 'elbow/capistrano_v2'
elbow
requires your aws credentials, set them in your config/deploy/yourstage.rb
set :aws_access_key_id, 'YOUR_ACCESS_KEY_ID'
set :aws_secret_access_key, 'YOUR_SECRET_ACCESS_KEY'
Tell elbow
that a host is using an ELB by specifying the elastic_load_balancer
configuration in in your config/deploy/yourstage.rb
. The first argument is the host name followed
by a list of roles.
elastic_load_balancer 'your-elb-100028747657.us-east-1.elb.amazonaws.com', roles: %w{web app}, user: 'youruser'
Important if you are using Capistrano version 2 then:
elastic_load_balancer 'your-elb-100028747657.us-east-1.elb.amazonaws.com', :app, :web
The host name is expected to be a CNAME for the ELB public DNS, as such a DNS looked is performed against the host name.
By default the ELB is assumed to be in the AWS region us-east-1
. You can use a
different region by setting the following in your config/deploy/yourstage.rb
set :aws_region, 'ap-southeast-2'
elbow is MIT licensed
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request