capistrano-autoscale-deploy 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -1,3 +1,4 @@
1
+ [![Gem Version](https://badge.fury.io/rb/capistrano-autoscale-deploy.png)](http://badge.fury.io/rb/capistrano-autoscale-deploy)
1
2
  # Capistrano AutoScale Deploy
2
3
 
3
4
  Capistrano plugin that enable discovery of instances in ec2 AutoScale groups into capistrano deployment script.
@@ -31,9 +32,10 @@ require 'capistrano/autoscale_deploy'
31
32
  And set credentials with AmazonEC2ReadOnlyAccess permission in config/deploy.rb as:
32
33
 
33
34
  ```ruby
34
- set :access_key_id, "YOUR ACCESS KEY ID"
35
- set :secret_access_key, "YOUR SECRET ACCESS KEY"
36
- set :region, "eu-west-1"
35
+ set :aws_default_region, 'eu-west-1'
36
+ set :aws_access_key_id, "YOUR AWS KEY ID"
37
+ set :aws_secret_access_key, "YOUR AWS SECRET KEY"
38
+
37
39
  ```
38
40
 
39
41
  ## Usage
@@ -49,7 +51,11 @@ you can add more autoscale configs to deploy to multiple autoscale groups like a
49
51
  ## How this works
50
52
 
51
53
  This gem will fetch only running instances that have an autoscale tag name you specified
52
- it will then reject the role of :db and the primary => true for all servers found but the first one
54
+
55
+ It will then reject the roles of :db and the :primary => true for all servers found **but the first one**
56
+
57
+ (from all autoscale groups you have specified such as using more then once the autoscale directive in your config - i.e cluster deploy)
58
+
53
59
  this is to make sure a single working task does not run in parallel
54
60
 
55
61
  you end up as if you defined the servers yourself like so:
@@ -62,7 +68,7 @@ server ip_address3, :app, :web
62
68
 
63
69
  ## Contributing
64
70
 
65
- 1. Fork it ( http://github.com/<my-github-username>/capistrano-ec2_tagged/fork )
71
+ 1. Fork it ( http://github.com/<my-github-username>/capistrano-autoscale-deploy/fork )
66
72
  2. Create your feature branch (`git checkout -b my-new-feature`)
67
73
  3. Commit your changes (`git commit -am 'Add some feature'`)
68
74
  4. Push to the branch (`git push origin my-new-feature`)
@@ -1,4 +1,4 @@
1
- # coding: utf-8
1
+ # encoding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'capistrano/autoscale_deploy/version'
@@ -35,10 +35,12 @@ module Capistrano
35
35
  logger.info("unable to connect to ec2: #{e}")
36
36
  end
37
37
 
38
- logger.info("found #{@ec2.instances.filter('tag-key', 'AutoScaleGroup').filter('tag-value', options[:AutoScaleGroup]).filter('instance-state-code', '16').count} servers for AutoScaleGroup: #{options[:AutoScaleGroup]} ")
39
-
40
38
  # => filter('instance-state-code', '16') only running instances
41
- @ec2.instances.filter('tag-key', 'AutoScaleGroup').filter('tag-value', options[:AutoScaleGroup]).filter('instance-state-code', '16').inject(instances){|acc, instance|
39
+ @ec2_instances = @ec2.instances.filter('tag-key', 'AutoScaleGroup').filter('tag-value', options[:AutoScaleGroup]).filter('instance-state-code', '16')
40
+
41
+ logger.info("found #{@ec2_instances.count} servers for AutoScaleGroup: #{options[:AutoScaleGroup]} ")
42
+
43
+ @ec2_instances.inject(instances){|acc, instance|
42
44
  acc[instance.ip_address] = options[:deploy_roles]
43
45
  acc
44
46
  }
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module AutoScaleDeploy
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-autoscale-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-26 00:00:00.000000000 Z
12
+ date: 2014-03-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk