9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/simple_deploy/cli/list.rb', line 9
def stacks
@opts = Trollop::options do
version SimpleDeploy::VERSION
banner <<-EOS
List stacks in an environment
simple_deploy list -e ENVIRONMENT
EOS
opt :environment, "Set the target environment", :type => :string
opt :log_level, "Log level: debug, info, warn, error", :type => :string,
:default => 'info'
opt :help, "Display Help"
end
valid_options? :provided => @opts,
:required => [:environment]
config = Config.new.environment @opts[:environment]
stacks = Stackster::StackLister.new(:config => config).all.sort
stack = Stack.new :environment => @opts[:environment],
:name => @opts[:name],
:config => config,
:logger => logger
puts stacks
end
|