Class: SimpleDeploy::Stack

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_deploy/stack.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Stack

Returns a new instance of Stack.



8
9
10
11
12
# File 'lib/simple_deploy/stack.rb', line 8

def initialize(args)
  @environment = args[:environment]
  @name = args[:name]
  @config = Config.new
end

Class Method Details

.list(args) ⇒ Object



14
15
16
# File 'lib/simple_deploy/stack.rb', line 14

def self.list(args)
  StackLister.new(:config => args[:config]).all
end

Instance Method Details

#attributesObject



59
60
61
# File 'lib/simple_deploy/stack.rb', line 59

def attributes
  stack.attributes 
end

#create(args) ⇒ Object



18
19
20
21
# File 'lib/simple_deploy/stack.rb', line 18

def create(args)
  stack.create :attributes => args[:attributes],
               :template => args[:template]
end

#deployObject



27
28
29
30
31
32
33
# File 'lib/simple_deploy/stack.rb', line 27

def deploy
  deployment = Deployment.new :config => @config,
                              :environment => @environment,
                              :instances => instances,
                              :attributes => attributes
  deployment.execute
end

#destroyObject



35
36
37
# File 'lib/simple_deploy/stack.rb', line 35

def destroy
  stack.destroy
end

#eventsObject



39
40
41
# File 'lib/simple_deploy/stack.rb', line 39

def events
  stack.events
end

#instancesObject



51
52
53
# File 'lib/simple_deploy/stack.rb', line 51

def instances
  stack.instances_public_ip_addresses
end

#outputsObject



43
44
45
# File 'lib/simple_deploy/stack.rb', line 43

def outputs
  stack.outputs
end

#resourcesObject



47
48
49
# File 'lib/simple_deploy/stack.rb', line 47

def resources
  stack.resources
end

#statusObject



55
56
57
# File 'lib/simple_deploy/stack.rb', line 55

def status
  stack.status
end

#templateObject



63
64
65
# File 'lib/simple_deploy/stack.rb', line 63

def template
  JSON.parse stack.template
end

#update(args) ⇒ Object



23
24
25
# File 'lib/simple_deploy/stack.rb', line 23

def update(args)
  stack.update :attributes => args[:attributes]
end