ecs_cmd 0.1.5 → 0.1.6

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
  SHA256:
3
- metadata.gz: c08e97f4e8cd649b696318ea56c6f50457d61f8bacaa967a4bebb3f8349a0d9b
4
- data.tar.gz: 9b5babb83bd7070b167e4a8740fdb608a50c6d338d911b83fccde8376e2b34af
3
+ metadata.gz: 76ede8bd9e4c5ae6fc5aa0bc4aa44177e420515140717a8969e16aa25d8a23af
4
+ data.tar.gz: 61216713159ce16f3330e0f29666c7e30146fbcf5b20c8ca500b3634a4821d92
5
5
  SHA512:
6
- metadata.gz: 6ded1958eeebb8872df2dc375adb3140aa0204496447f50018259d388bcea8941abab4ba01c1b4efe4395865610c3b8e5d2b052b6ffe3fda7d6acc9508f34d53
7
- data.tar.gz: a9484795dfa87ac144aa4d0fbf036cbcadacd6207d9904f98acd7252bb0a1ec3a5845ae55f7b19490996e173128f308eb86d631c1651f9482dbd43ab0ba8afff
6
+ metadata.gz: 493d391d282de54c6cd4824f1fc425090ffb9c314aa5204a2f8491c8aead4c6900824fa5a3376010faf85de394bd814d2c34e584cd34a495e5771357550aa199
7
+ data.tar.gz: 731efe713d5e46ecac433d32b6324874a86dce29cf8516bb84ba892753eee455731b239b08c815da5cc02ed7ec234934d65d76b7b4303dd5b307987e49744116
@@ -1,3 +1,7 @@
1
+ # 0.1.6
2
+
3
+ - bugfix: remove pry require
4
+
1
5
  # 0.1.4
2
6
 
3
7
  - Added user flag to shell command. `ecs-cmd shell -c production -s foo -u nobody`
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ecs_cmd (0.1.5)
4
+ ecs_cmd (0.1.6)
5
5
  aws-sdk-ec2
6
6
  aws-sdk-ecs
7
7
  gli (= 2.18.0)
@@ -26,8 +26,10 @@ GEM
26
26
  aws-sigv4 (1.0.3)
27
27
  coderay (1.1.2)
28
28
  diff-lcs (1.3)
29
+ docile (1.3.1)
29
30
  gli (2.18.0)
30
31
  jmespath (1.4.0)
32
+ json (2.1.0)
31
33
  method_source (0.9.0)
32
34
  pry (0.11.3)
33
35
  coderay (~> 1.1.0)
@@ -46,6 +48,11 @@ GEM
46
48
  diff-lcs (>= 1.2.0, < 2.0)
47
49
  rspec-support (~> 3.7.0)
48
50
  rspec-support (3.7.1)
51
+ simplecov (0.16.1)
52
+ docile (~> 1.1)
53
+ json (>= 1.8, < 3)
54
+ simplecov-html (~> 0.10.0)
55
+ simplecov-html (0.10.2)
49
56
  terminal-table (1.8.0)
50
57
  unicode-display_width (~> 1.1, >= 1.1.1)
51
58
  unicode-display_width (1.4.1)
@@ -60,6 +67,7 @@ DEPENDENCIES
60
67
  pry
61
68
  rake (~> 10.0)
62
69
  rspec (~> 3.0)
70
+ simplecov
63
71
 
64
72
  BUNDLED WITH
65
73
  1.16.3
@@ -29,8 +29,8 @@ command :get do |c|
29
29
  services.flag %i[c cluster], desc: 'cluster name', arg_name: 'cluster', required: true
30
30
  services.desc 'list services in a given ecs cluster'
31
31
  services.action do |global_options, options, _args|
32
- serv = EcsCmd::Services.new(global_options[:region])
33
- serv.list_services(options[:cluster])
32
+ serv = EcsCmd::Services.new(global_options[:region],options[:cluster])
33
+ serv.list_services
34
34
  end
35
35
  end
36
36
 
@@ -40,4 +40,5 @@ Gem::Specification.new do |spec|
40
40
  spec.add_development_dependency 'rake', '~> 10.0'
41
41
  spec.add_development_dependency 'rspec', '~> 3.0'
42
42
  spec.add_development_dependency 'pry'
43
+ spec.add_development_dependency 'simplecov'
43
44
  end
@@ -116,6 +116,10 @@ module EcsCmd
116
116
  @service_stats[0]['service_name']
117
117
  end
118
118
 
119
+ def launch_type
120
+ @service_stats[0]['deployments'][0]['launch_type']
121
+ end
122
+
119
123
  def list_container_instances
120
124
  t = []
121
125
  container_instances.each do |e|
@@ -137,7 +141,7 @@ module EcsCmd
137
141
  table2 = Terminal::Table.new headings: ['TASK DEFINITION'], rows: row2
138
142
  puts table1
139
143
  puts table2
140
- puts list_container_instances
144
+ puts list_container_instances unless launch_type == 'FARGATE'
141
145
  puts deployments
142
146
  end
143
147
  end
@@ -1,29 +1,29 @@
1
1
  require 'aws-sdk-ecs'
2
2
  require 'terminal-table'
3
- require 'pry'
4
3
 
5
4
  module EcsCmd
6
5
  class Services
7
- def initialize(region)
6
+ def initialize(region, cluster)
8
7
  @client = Aws::ECS::Client.new(region: region)
9
8
  @reg = region
9
+ @cluster = cluster
10
10
  end
11
11
 
12
- def get_services(cluster)
12
+ def get_services
13
13
  @service_arns = []
14
- @client.list_services(cluster: cluster).each do |r|
14
+ @client.list_services(cluster: @cluster).each do |r|
15
15
  @service_arns << r[0]
16
16
  @service_arns.flatten!
17
17
  end
18
18
  @service_arns
19
19
  end
20
20
 
21
- def list_services(cluster, reg = @reg)
22
- @service_list = get_services(cluster)
21
+ def list_services
22
+ @service_list = get_services
23
23
  rows = []
24
24
  @service_list.map do |service|
25
25
  service_name = service.split(%r{/}).last
26
- serv = EcsCmd::Service.new(cluster, service_name, reg)
26
+ serv = EcsCmd::Service.new(@cluster, service_name, @reg)
27
27
  rows << [service_name, serv.desired_count, serv.running_count, serv.pending_count]
28
28
  end
29
29
  table = Terminal::Table.new headings: ['SERVICE NAME', 'DESIRED_COUNT',
@@ -1,3 +1,3 @@
1
1
  module EcsCmd
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecs_cmd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Schaaff
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: simplecov
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  description: AWS ECS CLI Utility
126
140
  email:
127
141
  - dbschaaff@gmail.com