opsicle 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/bin/opsicle +1 -1
- data/lib/opsicle/commands/deploy.rb +1 -1
- data/lib/opsicle/commands/ssh.rb +1 -1
- data/lib/opsicle/monitor/app.rb +4 -4
- data/lib/opsicle/output.rb +27 -7
- data/lib/opsicle/version.rb +1 -1
- data/spec/opsicle/commands/ssh_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWMyN2Q2YjBkN2FiMTgwNjhjZjg2N2IwZTI3ZGVkYTFjYTdjY2NlMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzJhOGM3MzMwNDBmNDczMTcwYWRkNjFlYTM2NDJmNjVhMWY4OTM4Ng==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTRjZDg3ZjQ4MjQwYTBkZDEzOWZjMTE4ZWU5MGE1NWE1ZTI2OTg0ZjFhNGQ4
|
10
|
+
ZGQ4MmUwMzJjMzllZDc4Y2M4NjE0YzI3MzA0MzM2ODBjYWFjZGJmMDYwYWE2
|
11
|
+
YWQ0Y2EwMzI4ZDdjY2NjNTEyZTFlYjM1MTFlYjQ3Mjc3Yjc5YzQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Y2I5OWMyMTI1YjhkMjg4NjczYjc4YzU5OTQ0MGQ3YzI1MDY3ZDAzY2NmYTkx
|
14
|
+
MDk3MTc3NzI4NzJiMDUwZWU4MDg1NzRkNTcyODM1MDZjMDY3ODI4NGI1ZWJi
|
15
|
+
MWQ1MWQyZmNlNmE0YmE0MWEzNzdkOGM5NGMzOWRiMDY1ZjM0MTI=
|
data/bin/opsicle
CHANGED
@@ -101,7 +101,7 @@ long_desc """
|
|
101
101
|
"""
|
102
102
|
arg_name '<environment>'
|
103
103
|
command 'opsworks-url' do |c|
|
104
|
-
opsworks_pages = %w
|
104
|
+
opsworks_pages = %w(stack layers instances apps deployments monitoring resources permissions)
|
105
105
|
c.flag [:p, :page],
|
106
106
|
:desc => 'Request a specific page in the OpsWorks web interface',
|
107
107
|
:must_match => opsworks_pages,
|
@@ -28,7 +28,7 @@ module Opsicle
|
|
28
28
|
Output.say_verbose "Executing shell command: #{command}"
|
29
29
|
%x(#{command})
|
30
30
|
else
|
31
|
-
Output.say "Deploy failed. No deployment_id was received from OpsWorks",
|
31
|
+
Output.say "Deploy failed. No deployment_id was received from OpsWorks", :error
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
data/lib/opsicle/commands/ssh.rb
CHANGED
@@ -14,7 +14,7 @@ module Opsicle
|
|
14
14
|
instances.each_index do |x|
|
15
15
|
Output.say "#{x+1}) #{instances[x][:hostname]}"
|
16
16
|
end
|
17
|
-
choice = ask("? ", Integer) { |q| q.in = 1..instances.length }
|
17
|
+
choice = Output.ask("? ", Integer) { |q| q.in = 1..instances.length }
|
18
18
|
end
|
19
19
|
|
20
20
|
instance_ip = instances[choice-1][:elastic_ip] || instances[choice-1][:public_ip]
|
data/lib/opsicle/monitor/app.rb
CHANGED
@@ -64,10 +64,10 @@ module Opsicle
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def do_command(key)
|
67
|
-
command = { q
|
68
|
-
h
|
69
|
-
b
|
70
|
-
d
|
67
|
+
command = { 'q' => :stop,
|
68
|
+
'h' => [:set_screen, :help],
|
69
|
+
'b' => :open_opsworks_browser,
|
70
|
+
'd' => [:set_screen, :deployments] }[key]
|
71
71
|
command ||= :invalid_input
|
72
72
|
|
73
73
|
send *command unless command == :invalid_input
|
data/lib/opsicle/output.rb
CHANGED
@@ -1,17 +1,37 @@
|
|
1
|
-
require 'highline
|
1
|
+
require 'highline'
|
2
2
|
|
3
3
|
module Opsicle
|
4
4
|
module Output
|
5
|
-
def self.
|
6
|
-
|
7
|
-
|
5
|
+
def self.terminal
|
6
|
+
HighLine.color_scheme = color_scheme
|
7
|
+
@terminal ||= HighLine.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.color_scheme
|
11
|
+
@color_scheme ||= HighLine::ColorScheme.new(
|
12
|
+
:normal => [],
|
13
|
+
:error => [:bold, :red],
|
14
|
+
:warning => [:bold, :yellow],
|
15
|
+
:verbose => [:bold, :magenta],
|
16
|
+
:debug => [:bold, :cyan],
|
17
|
+
:success => [:bold, :green],
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.say(msg, log_style=:normal)
|
22
|
+
if $color
|
23
|
+
terminal.say "<%= color('#{msg}', '#{log_style}') %>"
|
8
24
|
else
|
9
|
-
|
25
|
+
terminal.say msg
|
10
26
|
end
|
11
27
|
end
|
12
28
|
|
13
|
-
def self.say_verbose(msg
|
14
|
-
|
29
|
+
def self.say_verbose(msg)
|
30
|
+
terminal.say "<%= color('#{msg}', 'verbose') %>" if $verbose
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.ask(*args)
|
34
|
+
terminal.ask(*args)
|
15
35
|
end
|
16
36
|
end
|
17
37
|
end
|
data/lib/opsicle/version.rb
CHANGED
@@ -14,7 +14,7 @@ module Opsicle
|
|
14
14
|
before do
|
15
15
|
allow(Output).to receive(:say)
|
16
16
|
allow(Output).to receive(:say_verbose)
|
17
|
-
allow(
|
17
|
+
allow(Output).to receive(:ask).and_return(2)
|
18
18
|
allow(subject).to receive(:ssh_username) {"mrderpyman2014"}
|
19
19
|
end
|
20
20
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opsicle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Fleener
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|