Class: SimpleDeploy::Stack
- Inherits:
-
Object
- Object
- SimpleDeploy::Stack
- Defined in:
- lib/simple_deploy/stack.rb
Class Method Summary collapse
Instance Method Summary collapse
- #attributes ⇒ Object
- #create(args) ⇒ Object
- #deploy ⇒ Object
- #destroy ⇒ Object
- #events ⇒ Object
-
#initialize(args) ⇒ Stack
constructor
A new instance of Stack.
- #instances ⇒ Object
- #outputs ⇒ Object
- #resources ⇒ Object
- #status ⇒ Object
- #template ⇒ Object
- #update(args) ⇒ Object
Constructor Details
#initialize(args) ⇒ Stack
Returns a new instance of Stack.
9 10 11 12 13 14 |
# File 'lib/simple_deploy/stack.rb', line 9 def initialize(args) @environment = args[:environment] @name = args[:name] @config = Config.new @config.logger = SimpleDeployLogger.new end |
Class Method Details
.list(args) ⇒ Object
16 17 18 |
# File 'lib/simple_deploy/stack.rb', line 16 def self.list(args) StackLister.new(:config => args[:config]).all end |
Instance Method Details
#attributes ⇒ Object
67 68 69 |
# File 'lib/simple_deploy/stack.rb', line 67 def attributes stack.attributes end |
#create(args) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/simple_deploy/stack.rb', line 20 def create(args) saf = StackAttributeFormater.new(:attributes => args[:attributes], :config => @config, :environment => @environment) stack.create :attributes => saf.updated_attributes, :template => args[:template] end |
#deploy ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/simple_deploy/stack.rb', line 35 def deploy deployment = Deployment.new :config => @config, :environment => @environment, :instances => instances, :attributes => attributes deployment.execute end |
#destroy ⇒ Object
43 44 45 |
# File 'lib/simple_deploy/stack.rb', line 43 def destroy stack.destroy end |
#events ⇒ Object
47 48 49 |
# File 'lib/simple_deploy/stack.rb', line 47 def events stack.events end |
#instances ⇒ Object
59 60 61 |
# File 'lib/simple_deploy/stack.rb', line 59 def instances stack.instances_private_ip_addresses end |
#outputs ⇒ Object
51 52 53 |
# File 'lib/simple_deploy/stack.rb', line 51 def outputs stack.outputs end |
#resources ⇒ Object
55 56 57 |
# File 'lib/simple_deploy/stack.rb', line 55 def resources stack.resources end |
#status ⇒ Object
63 64 65 |
# File 'lib/simple_deploy/stack.rb', line 63 def status stack.status end |
#template ⇒ Object
71 72 73 |
# File 'lib/simple_deploy/stack.rb', line 71 def template JSON.parse stack.template end |
#update(args) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/simple_deploy/stack.rb', line 28 def update(args) saf = StackAttributeFormater.new(:attributes => args[:attributes], :config => @config, :environment => @environment) stack.update :attributes => saf.updated_attributes end |