capistrano-elb 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/Gemfile +4 -0
- data/README.md +57 -0
- data/Rakefile +2 -0
- data/capistrano-elb.gemspec +25 -0
- data/lib/capistrano-elb/tasks.rb +0 -3
- data/lib/capistrano-elb/version.rb +5 -0
- metadata +30 -11
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
# CapistranoELB
|
2
|
+
A simple library to control Amazon Elastic Load Balancers for use within Capistrano
|
3
|
+
|
4
|
+
## Install
|
5
|
+
gem install capistrano-elb
|
6
|
+
|
7
|
+
## Usage
|
8
|
+
You should have ec2credentials.yaml in the same directory as your cap files
|
9
|
+
#ec2credentials.yaml
|
10
|
+
---
|
11
|
+
:aws_access_key_id: YOUR_KEY_ID_
|
12
|
+
:aws_secret_access_key: YOUR_KEY
|
13
|
+
|
14
|
+
then just
|
15
|
+
require "capistrano-elb/tasks"
|
16
|
+
|
17
|
+
This will instantiate an instance of the CapELB class and add hooks to remove/readd before/after deploys
|
18
|
+
|
19
|
+
(Equivalent to having the following in your deploy.rb)
|
20
|
+
require "capistrano-elb"
|
21
|
+
|
22
|
+
namespace :elb do
|
23
|
+
capELB = CapELB.new()
|
24
|
+
|
25
|
+
task :remove do
|
26
|
+
servers = roles[:web].servers.map {|server| server.host}
|
27
|
+
puts "Removing #{servers} from ELB"
|
28
|
+
capELB.remove servers
|
29
|
+
end
|
30
|
+
|
31
|
+
task :add do
|
32
|
+
servers = roles[:web].servers.map {|server| server.host}
|
33
|
+
puts "Adding #{servers} to ELB"
|
34
|
+
capELB.add servers
|
35
|
+
end
|
36
|
+
|
37
|
+
task :save do
|
38
|
+
capELB.save_config
|
39
|
+
end
|
40
|
+
|
41
|
+
task :check do
|
42
|
+
puts capELB.check_config
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
before "deploy", "elb:remove"
|
47
|
+
after "deploy", "elb:add"
|
48
|
+
|
49
|
+
The first time you run it a record of the ELB setup is saved to config/lbs.yaml, you can check/update this with
|
50
|
+
cap elb:check
|
51
|
+
cap elb:save
|
52
|
+
|
53
|
+
|
54
|
+
You can just require capistrano-elb and do whatever you want inside your deploy scripts of course
|
55
|
+
|
56
|
+
If you want to hook after deploy but before the elb:add you can target
|
57
|
+
after deploy:restart :your_task
|
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "capistrano-elb/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "capistrano-elb"
|
7
|
+
s.version = Capistrano::Elb::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["thattommyhall"]
|
10
|
+
s.email = ["tom.hall@forward.co.uk"]
|
11
|
+
s.homepage = "https://github.com/thattommyhall/capistrano-elb"
|
12
|
+
s.summary = %q{Automagically remove/readd servers from EC2 load balancers as you cap deploy}
|
13
|
+
s.description = %q{Capistrano plugin for removing/readd servers to EC2 load balancers}
|
14
|
+
|
15
|
+
s.rubyforge_project = "capistrano-elb"
|
16
|
+
|
17
|
+
s.add_dependency('fog')
|
18
|
+
s.add_dependency('excon')
|
19
|
+
s.add_dependency('capistrano')
|
20
|
+
|
21
|
+
s.files = `git ls-files`.split("\n")
|
22
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
23
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
24
|
+
s.require_paths = ["lib"]
|
25
|
+
end
|
data/lib/capistrano-elb/tasks.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-elb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-05-24 00:00:00.000000000 +01:00
|
13
|
+
default_executable:
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: fog
|
16
|
-
requirement: &
|
17
|
+
requirement: &2157682780 !ruby/object:Gem::Requirement
|
17
18
|
none: false
|
18
19
|
requirements:
|
19
20
|
- - ! '>='
|
@@ -21,10 +22,10 @@ dependencies:
|
|
21
22
|
version: '0'
|
22
23
|
type: :runtime
|
23
24
|
prerelease: false
|
24
|
-
version_requirements: *
|
25
|
+
version_requirements: *2157682780
|
25
26
|
- !ruby/object:Gem::Dependency
|
26
27
|
name: excon
|
27
|
-
requirement: &
|
28
|
+
requirement: &2157682360 !ruby/object:Gem::Requirement
|
28
29
|
none: false
|
29
30
|
requirements:
|
30
31
|
- - ! '>='
|
@@ -32,16 +33,34 @@ dependencies:
|
|
32
33
|
version: '0'
|
33
34
|
type: :runtime
|
34
35
|
prerelease: false
|
35
|
-
version_requirements: *
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
version_requirements: *2157682360
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: capistrano
|
39
|
+
requirement: &2157681940 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
type: :runtime
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *2157681940
|
48
|
+
description: Capistrano plugin for removing/readd servers to EC2 load balancers
|
49
|
+
email:
|
50
|
+
- tom.hall@forward.co.uk
|
39
51
|
executables: []
|
40
52
|
extensions: []
|
41
53
|
extra_rdoc_files: []
|
42
54
|
files:
|
55
|
+
- .gitignore
|
56
|
+
- Gemfile
|
57
|
+
- README.md
|
58
|
+
- Rakefile
|
59
|
+
- capistrano-elb.gemspec
|
43
60
|
- lib/capistrano-elb.rb
|
44
61
|
- lib/capistrano-elb/tasks.rb
|
62
|
+
- lib/capistrano-elb/version.rb
|
63
|
+
has_rdoc: true
|
45
64
|
homepage: https://github.com/thattommyhall/capistrano-elb
|
46
65
|
licenses: []
|
47
66
|
post_install_message:
|
@@ -61,8 +80,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
80
|
- !ruby/object:Gem::Version
|
62
81
|
version: '0'
|
63
82
|
requirements: []
|
64
|
-
rubyforge_project:
|
65
|
-
rubygems_version: 1.
|
83
|
+
rubyforge_project: capistrano-elb
|
84
|
+
rubygems_version: 1.6.2
|
66
85
|
signing_key:
|
67
86
|
specification_version: 3
|
68
87
|
summary: Automagically remove/readd servers from EC2 load balancers as you cap deploy
|