capistrano-getservers 1.0.1 → 1.0.2

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
@@ -20,13 +20,22 @@ Or install it yourself as:
20
20
 
21
21
  $ gem install capistrano-getservers
22
22
 
23
+ ## Requirements
24
+ Ruby Gems
25
+ * `gem 'capistrano'`
26
+ * `gem 'fog'`
27
+
28
+ Environment variables
29
+ * `export AWS_SECRET_ACCESS_KEY=''`
30
+ * `export AWS_ACCESS_KEY_ID=''`
31
+
23
32
  ## Usage
24
33
 
25
34
  ### Retrieving instances within Capistrano
26
35
 
27
36
  In your capistrano script:
28
37
  ```ruby
29
- get_servers(:db, {'app' => 'app_name', 'cluster' => 'cluster', 'environment' => 'environment' ... })
38
+ get_servers(:db, 'us-east-1', {'app' => 'app_name', 'cluster' => 'cluster', 'environment' => 'environment' ... })
30
39
  ```
31
40
 
32
41
  ### Retrieving instances from your CLI
@@ -35,7 +44,7 @@ In your capistrano script:
35
44
  ```ruby
36
45
  set :tags, ENV['TAGS'] || {}
37
46
  cli_tags = parse(tags)
38
- get_servers(cli_tags)
47
+ get_servers(:role, region, cli_tags)
39
48
  ```
40
49
 
41
50
  Then, via the command line:
@@ -45,10 +54,19 @@ Then, via the command line:
45
54
 
46
55
  ### Notes
47
56
 
57
+ You can pass `nil` as the second parameter to have capistrano-getservers
58
+ default to the `us-east-1` region.
59
+
48
60
  All servers will receive the role 'web' unless you specify a different
49
61
  role using the `get_servers` method.
50
62
 
51
- Example: `get_servers(:role,{})`
63
+ Example: `get_servers(:role,{'deploy' => 'some value', 'app' => 'some_value'})`
64
+
65
+ ## Changelog
66
+
67
+ Version 1.0.2:
68
+ * Added region support for Getservers. Had to change the function
69
+ get_servers for this, so it's now: get_servers(:role,'region',tags)
52
70
 
53
71
  ## Contributing
54
72
 
@@ -5,7 +5,7 @@ require 'capistrano-getservers/get_servers'
5
5
 
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = "capistrano-getservers"
8
- gem.version = '1.0.1'
8
+ gem.version = '1.0.2'
9
9
  gem.authors = ["Alfred Moreno"]
10
10
  gem.email = ["alfred.moreno@zumba.com"]
11
11
  gem.description = %q{A capistrano plugin for simplifying EC2 deployment processes}
@@ -21,11 +21,12 @@ module Capistrano
21
21
  #
22
22
  # Returns: Nothing
23
23
  #############################################################
24
- def get_servers(role=nil, cli_tags)
24
+ def get_servers(role=nil, region=nil, cli_tags)
25
25
 
26
26
  ec2 = Fog::Compute::AWS.new(
27
27
  aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
28
- aws_access_key_id: ENV['AWS_ACCESS_KEY_ID']
28
+ aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
29
+ region: region
29
30
  )
30
31
 
31
32
  ec2.servers.all.each do |instance|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-getservers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
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: 2012-10-11 00:00:00.000000000 Z
12
+ date: 2012-11-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano