instance_selector 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,16 +1,24 @@
1
1
  #!/usr/bin/env ruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'instance_selector' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
2
 
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
3
+ require 'slop'
4
+ require 'instance_selector'
12
5
 
13
- require 'rubygems'
14
- require 'bundler/setup'
6
+ opts = Slop.parse do
7
+ banner "Usage: ./instance_selector <options>"
15
8
 
16
- load Gem.bin_path('instance_selector', 'instance_selector')
9
+ on 'e=', 'environment=', "The environment servers are tagged with"
10
+ on 'r=', 'role=', "The role servers are tagged with"
11
+ end
12
+
13
+ if opts[:e] && opts[:r]
14
+ filters = {}
15
+ filters["tag:Role"] = opts[:r]
16
+ filters["tag:Environment"] = opts[:e]
17
+
18
+ client = InstanceSelector::Connection.factory(:aws)
19
+ instances = client.instances(filters)
20
+
21
+ instances.each {|i| puts i[0]}
22
+ else
23
+ puts opts
24
+ end
@@ -1,3 +1,3 @@
1
1
  module InstanceSelector
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: instance_selector
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.0.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kevin McFadden
@@ -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: 3503566425414564058
111
+ hash: -1861840785183062298
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: 3503566425414564058
120
+ hash: -1861840785183062298
121
121
  version: '0'
122
122
  none: false
123
123
  requirements: []