stacco 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/bin/stacco +12 -7
  2. data/lib/stacco.rb +4 -0
  3. data/stacco.gemspec +1 -1
  4. metadata +1 -1
data/bin/stacco CHANGED
@@ -14,6 +14,8 @@ class String
14
14
  return :cyan unless self.kind_of? String
15
15
 
16
16
  case self
17
+ when /DOWN$/
18
+ :red
17
19
  when /COMPLETE$/
18
20
  :green
19
21
  when /IN_PROGRESS$/
@@ -73,15 +75,22 @@ unless orch_config_path.file?
73
75
  end
74
76
 
75
77
  orch = Stacco::Orchestrator.from_config(orch_config_path)
78
+ stacks = orch.stacks
76
79
 
77
- if subcommand == :define
80
+ case subcommand
81
+ when :"stacks:list"
82
+ puts "known stacks:"
83
+ stacks.each do |st|
84
+ puts " #{st.name.colored(st.status.guess_color)}"
85
+ end
86
+ Kernel.exit 0
87
+ when :"stacks:import"
78
88
  stack_defn = $stdin.read
79
89
  stack = orch.define_stack stack_defn
80
- puts "stack '#{stack.name}' defined"
90
+ puts "stack '#{stack.name}' imported"
81
91
  Kernel.exit 0
82
92
  end
83
93
 
84
- stacks = orch.stacks
85
94
  case stacks.length
86
95
  when 0
87
96
  $stderr.puts "no stacks defined!"
@@ -101,10 +110,6 @@ else
101
110
 
102
111
  unless stack
103
112
  $stderr.puts "unknown stack '#{stack_name}'"
104
- $stderr.puts "known stacks:"
105
- stacks.each do |st|
106
- $stderr.puts " #{st.name}"
107
- end
108
113
  Kernel.exit 1
109
114
  end
110
115
  end
data/lib/stacco.rb CHANGED
@@ -219,6 +219,10 @@ class Stacco::Stack
219
219
  @aws_stack.status
220
220
  end
221
221
 
222
+ def status
223
+ self.up? ? self.aws_status : "DOWN"
224
+ end
225
+
222
226
  def config
223
227
  YAML.load(@config_object.read)
224
228
  end
data/stacco.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'stacco'
3
- s.version = '0.1.6'
3
+ s.version = '0.1.7'
4
4
  s.licenses = ['MIT']
5
5
  s.summary = "CloudFormation stack manipulator"
6
6
  s.description = "AWS CloudFromation stack manipulation toolsuite"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stacco
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: