capistrano-autoscale-deploy 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
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 :
|
35
|
-
set :
|
36
|
-
set :
|
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
|
-
|
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-
|
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`)
|
@@ -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')
|
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
|
}
|
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.
|
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-
|
12
|
+
date: 2014-03-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk
|