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 ADDED
@@ -0,0 +1,6 @@
1
+ ec2credentials.yaml*
2
+ lbs.yaml*
3
+ *.gem
4
+ .bundle
5
+ Gemfile.lock
6
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in capistrano-elb.gemspec
4
+ gemspec
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,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -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
@@ -24,7 +24,4 @@ Capistrano::Configuration.instance(:must_exist).load do
24
24
  puts capELB.check_config
25
25
  end
26
26
  end
27
-
28
- before "deploy", "elb:remove"
29
- after "deploy", "elb:add"
30
27
  end
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module Elb
3
+ VERSION = "0.3.2"
4
+ end
5
+ end
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.1
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-04-11 00:00:00.000000000Z
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: &2157557080 !ruby/object:Gem::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: *2157557080
25
+ version_requirements: *2157682780
25
26
  - !ruby/object:Gem::Dependency
26
27
  name: excon
27
- requirement: &2157556460 !ruby/object:Gem::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: *2157556460
36
- description: Automagically remove/readd servers from EC2 load balancers as you cap
37
- deploy
38
- email: tom.hall@forward.co.uk
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.7.2
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