instance_selector 0.0.5 → 0.0.7

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
@@ -40,6 +40,17 @@ By default, only running instances will be included in the results. Overriding
40
40
  require 'instance_selector/capistrano'
41
41
  instance_selector :app, :aws, :tags => {"Environment" => "staging", "Role" => "web"}
42
42
 
43
+ ### Generic with Capistrano
44
+
45
+ # Centralized instance selector config
46
+ on :after, only: stages do
47
+ @logger.log 1, "Selecting instances from the cloud"
48
+ instance_selector :app, :aws, tags: {"Environment" => stage, "Role" => "social-web"}
49
+ instance_selector :sidekiq, :aws, tags: {"Environment" => stage, "Role" => "social-sidekiq"}
50
+ # NOTE: Only one cron host is supported! Tag appropriately.
51
+ instance_selector :cron, :aws, tags: {"Environment" => stage, "CronRole" => "social-web"}
52
+ end
53
+
43
54
  ### Filters
44
55
 
45
56
  http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeInstances.html
@@ -5,5 +5,15 @@ Capistrano::Configuration.instance(:must_exist).load do
5
5
  client = InstanceSelector::Connection.factory(provider)
6
6
  instances = client.instances(client.args_to_filters(args))
7
7
  instances.keys.each { |instance| role(cap_role, *instances.keys) }
8
+ _cset(:instance_selector_instances) { instances }
8
9
  end
10
+
11
+ # Not namespaced due to collision with the above method.
12
+ desc "List all cloud instances for a stage"
13
+ task :instance_selector_list do
14
+ fetch(:instance_selector_instances).each do |instance|
15
+ puts instance.join("\t")
16
+ end
17
+ end
18
+
9
19
  end
@@ -1,3 +1,3 @@
1
1
  module InstanceSelector
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: instance_selector
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.5
5
+ version: 0.0.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kevin McFadden
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-12 00:00:00.000000000 Z
12
+ date: 2013-07-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fog
@@ -108,7 +108,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  segments:
110
110
  - 0
111
- hash: -1104541862489150209
111
+ hash: 2403320103522617587
112
112
  version: '0'
113
113
  none: false
114
114
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  - !ruby/object:Gem::Version
118
118
  segments:
119
119
  - 0
120
- hash: -1104541862489150209
120
+ hash: 2403320103522617587
121
121
  version: '0'
122
122
  none: false
123
123
  requirements: []