opzworks 0.3.13 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/opzworks/cli.rb +6 -1
- data/lib/opzworks/commands/cmd.rb +40 -0
- data/lib/opzworks/meta.rb +1 -1
- data/lib/opzworks.rb +1 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80563c605a5de8f932029a8991137546de482d48
|
4
|
+
data.tar.gz: 225f1ecd7111ed50dcdd45dccca4ebda492d894b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78433773119c6dbefcfe1840b02e116595f1fd8f30cdbc6db04166c13f9928b029855af8e9fd22d54058fb64b16740d023d415412ce5f97e0a1a822e1ff3b3d2
|
7
|
+
data.tar.gz: 04a3612efdc14da926762cda8ccdf7443c18a0da7c312b4feb0e886699ceddc37b6d30f34767d5503b0bb199f46eadcf26f6c2894156dff2b7d40bddd80ec5b8
|
data/CHANGELOG.md
CHANGED
data/lib/opzworks/cli.rb
CHANGED
@@ -4,6 +4,8 @@ require 'opzworks'
|
|
4
4
|
module OpzWorks
|
5
5
|
class CLI
|
6
6
|
def self.start
|
7
|
+
commands = %w(ssh cmd json berks elastic)
|
8
|
+
|
7
9
|
Trollop.options do
|
8
10
|
version "opzworks #{OpzWorks::VERSION} (c) #{OpzWorks::AUTHORS.join(', ')}"
|
9
11
|
banner <<-EOS.unindent
|
@@ -13,6 +15,7 @@ module OpzWorks
|
|
13
15
|
|
14
16
|
Commands
|
15
17
|
ssh #{OpzWorks::Commands::SSH.banner}
|
18
|
+
cmd #{OpzWorks::Commands::CMD.banner}
|
16
19
|
json #{OpzWorks::Commands::JSON.banner}
|
17
20
|
berks #{OpzWorks::Commands::BERKS.banner}
|
18
21
|
elastic #{OpzWorks::Commands::ELASTIC.banner}
|
@@ -22,7 +25,7 @@ module OpzWorks
|
|
22
25
|
|
23
26
|
Options:
|
24
27
|
EOS
|
25
|
-
stop_on
|
28
|
+
stop_on commands
|
26
29
|
end
|
27
30
|
|
28
31
|
command = ARGV.shift
|
@@ -35,6 +38,8 @@ module OpzWorks
|
|
35
38
|
OpzWorks::Commands::BERKS.run
|
36
39
|
when 'elastic'
|
37
40
|
OpzWorks::Commands::ELASTIC.run
|
41
|
+
when 'cmd'
|
42
|
+
OpzWorks::Commands::CMD.run
|
38
43
|
when nil
|
39
44
|
Trollop.die 'no command specified'
|
40
45
|
else
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'aws-sdk'
|
2
|
+
require 'trollop'
|
3
|
+
require 'opzworks'
|
4
|
+
require 'rainbow/ext/string'
|
5
|
+
|
6
|
+
module OpzWorks
|
7
|
+
class Commands
|
8
|
+
class CMD
|
9
|
+
def self.banner
|
10
|
+
'Run various OpsWorks commands'
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.run
|
14
|
+
options = Trollop.options do
|
15
|
+
banner <<-EOS.unindent
|
16
|
+
#{CMD.banner}
|
17
|
+
|
18
|
+
opzworks cmd [option]
|
19
|
+
|
20
|
+
Options:
|
21
|
+
EOS
|
22
|
+
opt :'list-stacks', 'List all our stacks', default: false
|
23
|
+
end
|
24
|
+
|
25
|
+
config = OpzWorks.config
|
26
|
+
client = Aws::OpsWorks::Client.new(region: config.aws_region, profile: config.aws_profile)
|
27
|
+
|
28
|
+
if options[:'list-stacks']
|
29
|
+
list = []
|
30
|
+
response = client.describe_stacks
|
31
|
+
response[:stacks].each { |stack| list << stack[:name] }
|
32
|
+
|
33
|
+
puts list.sort
|
34
|
+
else
|
35
|
+
puts 'No options specified'.foreground(:yellow)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/opzworks/meta.rb
CHANGED
data/lib/opzworks.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opzworks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grant Heffernan
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-01-
|
12
|
+
date: 2016-01-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk
|
@@ -198,6 +198,7 @@ files:
|
|
198
198
|
- lib/opzworks.rb
|
199
199
|
- lib/opzworks/cli.rb
|
200
200
|
- lib/opzworks/commands/berks.rb
|
201
|
+
- lib/opzworks/commands/cmd.rb
|
201
202
|
- lib/opzworks/commands/elastic.rb
|
202
203
|
- lib/opzworks/commands/include/elastic.rb
|
203
204
|
- lib/opzworks/commands/include/manage_berks_repos.rb
|