fleetctl-setup 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b4da79067c77994706ba1706c71c0ffb19aa03c
4
- data.tar.gz: ff173a80f4a7ae15d637449d2886fd9b3293535c
3
+ metadata.gz: 2a21b86ebbc674bf2933ad7ecf0197b21ea9713a
4
+ data.tar.gz: 1917e402b8e099f8f7f147eb49cb2ad218dc3fe2
5
5
  SHA512:
6
- metadata.gz: 8c8354cd779c07571d1d778e5ba1cf42e3fa92ecfc2633207c9aabee37d144ad7d5eeb9b157f1bf25fe5f21ab65cb23010a75f4cfd3190404b25ddbf7494881e
7
- data.tar.gz: d523f2825cab921997aacfd4729b6982b53eb43860f8d661ed6b972b0c8b532857f9b2bc949d13ee048290810d4ff3f5ed462bc577bc6ab0c0bd8cdcdb851478
6
+ metadata.gz: 4935d753b04cb44c9b9851e1a218e08f5860ccd9a55d042de4a5b3d11ce64d32c27f6838d542374ef85e50e6056872616f8ccc6d413f52b0a3b24fabae895552
7
+ data.tar.gz: dd25b7e0233efb0fb6239b05ced282d60311c2002a7d770e596a92f998be1c1fc8fc4a471ecaf2530e5b0ee6070ab619df088347a8ffe350b0c51f624d34e38b
@@ -5,6 +5,11 @@ require 'fleetctl/setup/cli'
5
5
  cli = Fleetctl::Setup::CLI.new(ARGV)
6
6
  cli.parse_opts!
7
7
 
8
+ if cli.instance_ips.empty?
9
+ warn "No instances found."
10
+ exit 1
11
+ end
12
+
8
13
  warn "Picking randomly from #{cli.instance_ips.join(', ')}."
9
14
  ip_address = cli.instance_ips.sample
10
15
 
@@ -21,5 +21,5 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "bundler", "~> 1.5"
22
22
  spec.add_development_dependency "pry"
23
23
  spec.add_development_dependency "rake"
24
- spec.add_dependency "aws-sdk-core", ">= 2.0.0.rc6"
24
+ spec.add_dependency "aws-sdk-core", '~> 2.0.0'
25
25
  end
@@ -15,7 +15,7 @@ module Fleetctl::Setup
15
15
 
16
16
  def instances
17
17
  [].tap do |instances|
18
- Aws.ec2.describe_instances(filters: [filter]).each do |response|
18
+ ec2.describe_instances(filters: [filter]).each do |response|
19
19
  response.reservations.each do |res|
20
20
  instances.concat res.instances
21
21
  end
@@ -25,6 +25,10 @@ module Fleetctl::Setup
25
25
 
26
26
  private
27
27
 
28
+ def ec2
29
+ @ec2 ||= Aws::EC2::Client.new
30
+ end
31
+
28
32
  def filter
29
33
  { name: 'tag:aws:cloudformation:stack-id', values: [@resource.stack_id] }
30
34
  end
@@ -53,10 +57,8 @@ module Fleetctl::Setup
53
57
  end
54
58
 
55
59
  def all_resources
56
- @all_resources ||= Aws::CloudFormation.new.describe_stacks.stacks
60
+ @all_resources ||= Aws::CloudFormation::Client.new.describe_stacks.stacks
57
61
  end
58
62
  end
59
63
  end
60
64
  end
61
-
62
-
@@ -34,13 +34,15 @@ module Fleetctl::Setup
34
34
  return @instance_ips if @instance_ips
35
35
 
36
36
  results = AWS::Search.search(options[:search_term])
37
- raise "No results found" if results.empty?
37
+ if results.empty?
38
+ warn "No stack results found for '#{options[:search_term]}'"
39
+ exit 1
40
+ end
38
41
 
39
42
  choice = user_choice(results)
40
43
  warn "Looking up instances for #{choice.description}"
41
44
 
42
45
  @instance_ips = choice.instances.map(&:public_ip_address).compact
43
- warn "No instances found" if @instance_ips.empty?
44
46
  return @instance_ips
45
47
  end
46
48
 
@@ -1,5 +1,5 @@
1
1
  module Fleetctl
2
2
  module Setup
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fleetctl-setup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Taylor Long
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-25 00:00:00.000000000 Z
11
+ date: 2014-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: aws-sdk-core
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 2.0.0.rc6
61
+ version: 2.0.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 2.0.0.rc6
68
+ version: 2.0.0
69
69
  description: Finds the public IP of a random node on a CodeOS cluster running in AWS,
70
70
  and sets the FLEETCTL_TUNNEL variable to allow dev-ops engineers a simple workflow
71
71
  of controlling CoreOS cluster without delving into the AWS console each time
@@ -108,10 +108,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  requirements: []
110
110
  rubyforge_project:
111
- rubygems_version: 2.2.0
111
+ rubygems_version: 2.2.2
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Determines the endpoint for a CoreOS node in a cluster running on Amazon
115
115
  Web Services
116
116
  test_files: []
117
- has_rdoc: