sonic-screwdriver 2.0.0 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,13 +1,13 @@
1
- List ec2 servers. A filter must be provided. The filter can be a mix of instance ids and ec2 tags. sonic list will auto-detect the what type of filter it is filter appropriately. The filter for listing is optional.
1
+ A filter must be provided. The filter can be a mix of instance ids and ec2 tags. sonic list will auto-detect the what type of filter it is. The filter is optional.
2
2
 
3
- Examples:
3
+ ## Examples
4
4
 
5
5
  $ sonic list
6
6
  $ sonic list hi-web-prod
7
7
  $ sonic list hi-web-prod,hi-clock-prod
8
8
  $ sonic list i-09482b1a6e330fbf7
9
9
 
10
- Example Output:
10
+ ## Example Output
11
11
 
12
12
  $ sonic list --header i-09482b1a6e330fbf7
13
13
  Instance Id Public IP Private IP Type
data/lib/sonic/list.rb CHANGED
@@ -35,7 +35,7 @@ module Sonic
35
35
 
36
36
  if @options[:header] && !zero_instances
37
37
  header = ["Instance Id", "Name", "Public IP", "Private IP", "Type"]
38
- UI.say header.join("\t").colorize(:green)
38
+ UI.say header.join("\t").color(:green)
39
39
  end
40
40
 
41
41
  instances.each do |i|
data/lib/sonic/ssh.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'colorize'
2
-
3
1
  module Sonic
4
2
  class Ssh
5
3
  autoload :IdentifierDetector, 'sonic/ssh/identifier_detector'
@@ -14,7 +12,7 @@ module Sonic
14
12
  @user, @identifier = extract_user!(identifier) # extracts/strips user from identifier
15
13
  # While --user option is supported at the class level, don't expose at the CLI level
16
14
  # to encourage users to use user@host notation.
17
- @user ||= options[:user] || settings["bastion"]["user"]
15
+ @user ||= options[:user] || settings["ssh"]["user"]
18
16
 
19
17
  @service = @identifier # always set service even though it's not always used as the identifier
20
18
  map = settings["ecs_service_cluster_map"]
@@ -82,7 +80,7 @@ module Sonic
82
80
  def kernel_exec(*args)
83
81
  # append the optional command that can be provided to the ssh command
84
82
  full_command = args + @options[:command]
85
- puts "=> #{full_command.join(' ')}".colorize(:green)
83
+ puts "=> #{full_command.join(' ')}".color(:green)
86
84
  # https://ruby-doc.org/core-2.3.1/Kernel.html#method-i-exec
87
85
  # Using 2nd form
88
86
  Kernel.exec(*full_command) unless @options[:noop]
@@ -73,7 +73,7 @@ class Ssh
73
73
 
74
74
  task = response.tasks.first
75
75
  unless task
76
- puts "Unable to find a #{task_arn.green} container instance or task in the #{@cluster.green} cluster."
76
+ puts "Unable to find a #{task_arn.color(:green)} container instance or task in the #{@cluster.color(:green)} cluster."
77
77
  exit 1
78
78
  end
79
79
 
data/lib/sonic/ui.rb CHANGED
@@ -19,10 +19,10 @@ module Sonic
19
19
  puts msg unless mute
20
20
  end
21
21
  def error(msg='')
22
- say "ERROR: #{msg}".colorize(:red)
22
+ say "ERROR: #{msg}".color(:red)
23
23
  end
24
24
  def warn(msg='')
25
- say "WARN: #{msg}".colorize(:yellow)
25
+ say "WARN: #{msg}".color(:yellow)
26
26
  end
27
27
  end
28
28
  end
data/lib/sonic/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sonic
2
- VERSION = "2.0.0"
2
+ VERSION = "2.2.2"
3
3
  end
data/sonic.gemspec CHANGED
@@ -23,9 +23,9 @@ Gem::Specification.new do |spec|
23
23
  spec.add_dependency "aws-sdk-ecs"
24
24
  spec.add_dependency "aws-sdk-s3"
25
25
  spec.add_dependency "aws-sdk-ssm"
26
- spec.add_dependency "colorize"
27
26
  spec.add_dependency "hashie"
28
27
  spec.add_dependency "memoist"
28
+ spec.add_dependency "rainbow"
29
29
  spec.add_dependency "thor"
30
30
  spec.add_dependency "tty-prompt"
31
31
 
data/spec/lib/cli_spec.rb CHANGED
@@ -11,8 +11,13 @@ describe Sonic::CLI do
11
11
  expect(out).to include("=> ssh")
12
12
  end
13
13
 
14
- it "execute should print that command has been sent" do
15
- out = execute("exe/sonic execute #{@args} 1,2,3 uptime")
14
+ it "execute should print that command has been sent --instance-ids" do
15
+ out = execute("exe/sonic execute #{@args} --instance-ids i-1,i-2,i-3 uptime")
16
+ expect(out).to include("Command sent")
17
+ end
18
+
19
+ it "execute should print that command has been sent --tags" do
20
+ out = execute("exe/sonic execute #{@args} --tags Name=value uptime")
16
21
  expect(out).to include("Command sent")
17
22
  end
18
23
 
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe Sonic::Execute do
4
4
  before(:each) do
5
5
  @options = {
6
- filter: "i-066b140d9479e9681,i-09482b1a6e330fbf7"
6
+ instance_ids: "i-066b140d9479e9681,i-09482b1a6e330fbf7"
7
7
  }
8
8
  end
9
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sonic-screwdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-01 00:00:00.000000000 Z
11
+ date: 2021-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: colorize
84
+ name: hashie
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -95,7 +95,7 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: hashie
98
+ name: memoist
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="
@@ -109,7 +109,7 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: memoist
112
+ name: rainbow
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
@@ -260,11 +260,9 @@ files:
260
260
  - ".circleci/config.yml"
261
261
  - ".gitignore"
262
262
  - ".rspec"
263
- - ".ruby-version"
264
263
  - CHANGELOG.md
265
264
  - CONTRIBUTING.md
266
265
  - Gemfile
267
- - Gemfile.lock
268
266
  - Guardfile
269
267
  - LICENSE.txt
270
268
  - README.md
@@ -421,8 +419,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
421
419
  - !ruby/object:Gem::Version
422
420
  version: '0'
423
421
  requirements: []
424
- rubyforge_project:
425
- rubygems_version: 2.7.6
422
+ rubygems_version: 3.2.5
426
423
  signing_key:
427
424
  specification_version: 4
428
425
  summary: Multi-functional tool to manage AWS infrastructure
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.5.1
data/Gemfile.lock DELETED
@@ -1,163 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- sonic-screwdriver (2.0.0)
5
- activesupport
6
- aws-sdk-ec2
7
- aws-sdk-ecs
8
- aws-sdk-s3
9
- aws-sdk-ssm
10
- colorize
11
- hashie
12
- memoist
13
- thor
14
- tty-prompt
15
-
16
- GEM
17
- remote: https://rubygems.org/
18
- specs:
19
- activesupport (5.2.0)
20
- concurrent-ruby (~> 1.0, >= 1.0.2)
21
- i18n (>= 0.7, < 2)
22
- minitest (~> 5.1)
23
- tzinfo (~> 1.1)
24
- aws-eventstream (1.0.0)
25
- aws-partitions (1.89.1)
26
- aws-sdk-core (3.21.2)
27
- aws-eventstream (~> 1.0)
28
- aws-partitions (~> 1.0)
29
- aws-sigv4 (~> 1.0)
30
- jmespath (~> 1.0)
31
- aws-sdk-ec2 (1.34.0)
32
- aws-sdk-core (~> 3)
33
- aws-sigv4 (~> 1.0)
34
- aws-sdk-ecs (1.13.0)
35
- aws-sdk-core (~> 3)
36
- aws-sigv4 (~> 1.0)
37
- aws-sdk-kms (1.5.0)
38
- aws-sdk-core (~> 3)
39
- aws-sigv4 (~> 1.0)
40
- aws-sdk-s3 (1.13.0)
41
- aws-sdk-core (~> 3, >= 3.21.2)
42
- aws-sdk-kms (~> 1)
43
- aws-sigv4 (~> 1.0)
44
- aws-sdk-ssm (1.13.0)
45
- aws-sdk-core (~> 3)
46
- aws-sigv4 (~> 1.0)
47
- aws-sigv4 (1.0.2)
48
- byebug (10.0.2)
49
- cli_markdown (0.1.0)
50
- codeclimate-test-reporter (1.0.8)
51
- simplecov (<= 0.13)
52
- coderay (1.1.2)
53
- colorize (0.8.1)
54
- concurrent-ruby (1.0.5)
55
- diff-lcs (1.3)
56
- docile (1.1.5)
57
- equatable (0.5.0)
58
- ffi (1.9.23)
59
- formatador (0.2.5)
60
- guard (2.14.2)
61
- formatador (>= 0.2.4)
62
- listen (>= 2.7, < 4.0)
63
- lumberjack (>= 1.0.12, < 2.0)
64
- nenv (~> 0.1)
65
- notiffany (~> 0.0)
66
- pry (>= 0.9.12)
67
- shellany (~> 0.0)
68
- thor (>= 0.18.1)
69
- guard-bundler (2.1.0)
70
- bundler (~> 1.0)
71
- guard (~> 2.2)
72
- guard-compat (~> 1.1)
73
- guard-compat (1.2.1)
74
- guard-rspec (4.7.3)
75
- guard (~> 2.1)
76
- guard-compat (~> 1.1)
77
- rspec (>= 2.99.0, < 4.0)
78
- hashie (3.5.7)
79
- hitimes (1.2.6)
80
- i18n (1.0.1)
81
- concurrent-ruby (~> 1.0)
82
- jmespath (1.4.0)
83
- json (2.1.0)
84
- listen (3.1.5)
85
- rb-fsevent (~> 0.9, >= 0.9.4)
86
- rb-inotify (~> 0.9, >= 0.9.7)
87
- ruby_dep (~> 1.2)
88
- lumberjack (1.0.13)
89
- memoist (0.16.0)
90
- method_source (0.9.0)
91
- minitest (5.11.3)
92
- necromancer (0.4.0)
93
- nenv (0.3.0)
94
- notiffany (0.1.1)
95
- nenv (~> 0.1)
96
- shellany (~> 0.0)
97
- pastel (0.7.2)
98
- equatable (~> 0.5.0)
99
- tty-color (~> 0.4.0)
100
- pry (0.11.3)
101
- coderay (~> 1.1.0)
102
- method_source (~> 0.9.0)
103
- rake (12.3.1)
104
- rb-fsevent (0.10.3)
105
- rb-inotify (0.9.10)
106
- ffi (>= 0.5.0, < 2)
107
- rspec (3.7.0)
108
- rspec-core (~> 3.7.0)
109
- rspec-expectations (~> 3.7.0)
110
- rspec-mocks (~> 3.7.0)
111
- rspec-core (3.7.1)
112
- rspec-support (~> 3.7.0)
113
- rspec-expectations (3.7.0)
114
- diff-lcs (>= 1.2.0, < 2.0)
115
- rspec-support (~> 3.7.0)
116
- rspec-mocks (3.7.0)
117
- diff-lcs (>= 1.2.0, < 2.0)
118
- rspec-support (~> 3.7.0)
119
- rspec-support (3.7.1)
120
- ruby_dep (1.5.0)
121
- shellany (0.0.1)
122
- simplecov (0.13.0)
123
- docile (~> 1.1.0)
124
- json (>= 1.8, < 3)
125
- simplecov-html (~> 0.10.0)
126
- simplecov-html (0.10.2)
127
- thor (0.20.0)
128
- thread_safe (0.3.6)
129
- timers (4.1.2)
130
- hitimes
131
- tty-color (0.4.2)
132
- tty-cursor (0.5.0)
133
- tty-prompt (0.16.1)
134
- necromancer (~> 0.4.0)
135
- pastel (~> 0.7.0)
136
- timers (~> 4.0)
137
- tty-cursor (~> 0.5.0)
138
- tty-reader (~> 0.3.0)
139
- tty-reader (0.3.0)
140
- tty-cursor (~> 0.5.0)
141
- tty-screen (~> 0.6.4)
142
- wisper (~> 2.0.0)
143
- tty-screen (0.6.4)
144
- tzinfo (1.2.5)
145
- thread_safe (~> 0.1)
146
- wisper (2.0.0)
147
-
148
- PLATFORMS
149
- ruby
150
-
151
- DEPENDENCIES
152
- bundler
153
- byebug
154
- cli_markdown
155
- codeclimate-test-reporter
156
- guard
157
- guard-bundler
158
- guard-rspec
159
- rake
160
- sonic-screwdriver!
161
-
162
- BUNDLED WITH
163
- 1.16.1