Module: StackMate::StackPi

Included in:
StackNest
Defined in:
lib/stackmate/stackpi.rb

Class Method Summary collapse

Class Method Details

.create_stack(file, stack_name, params, wait_conditions) ⇒ Object

class Create include Logging



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
# File 'lib/stackmate/stackpi.rb', line 10

def self.create_stack(file,stack_name,params,wait_conditions)
  # Thread.new do
  #     StackMate::WaitConditionServer.run!
  # end
  engine = Ruote::Dashboard.new(
    Ruote::Worker.new(
  Ruote::HashStorage.new))
  engine.noisy = ENV['NOISY'] == 'true'
  engine.configure('wait_logger_timeout', 600)
  # engine.on_error = Ruote.process_definition do
  #    p("Error : StackPi create stack for #{stack_name} failed!")
  # end
  unknown = nil
  unresolved = catch(:unresolved) do
    unknown = catch(:unknown) do
      api_opts = {:APIKEY => "#{ENV['APIKEY']}", :SECKEY => "#{ENV['SECKEY']}", :URL => "#{ENV['URL']}" }
      p = StackMate::StackExecutor.new(file,stack_name,params,engine,wait_conditions,api_opts)
      p.launch()
      nil
    end
    nil
  end
  puts 'Failed to resolve parameters ' + unresolved.to_s if unresolved
  print "Sorry, I don't know how to create resources of type: ", unknown, "\n" if unknown
end

.delete_stack(file, stack_name, params, wait_conditions) ⇒ Object



36
37
38
# File 'lib/stackmate/stackpi.rb', line 36

def self.delete_stack(file,stack_name,params,wait_conditions)

end