Class: CfDeployer::DeploymentStrategy::BlueGreen
- Defined in:
- lib/cf_deployer/deployment_strategy/blue_green.rb
Direct Known Subclasses
Constant Summary
Constants inherited from Base
CfDeployer::DeploymentStrategy::Base::BLUE_GREEN_STRATEGY
Instance Attribute Summary
Attributes inherited from Base
#application_name, #component_name, #context, #environment_name
Instance Method Summary collapse
- #destroy ⇒ Object
- #exists? ⇒ Boolean
- #output_value(key) ⇒ Object
- #status(get_resource_statuses = false) ⇒ Object
Methods inherited from Base
#blue_green_strategy?, #initialize
Constructor Details
This class inherits a constructor from CfDeployer::DeploymentStrategy::Base
Instance Method Details
#destroy ⇒ Object
9 10 11 12 |
# File 'lib/cf_deployer/deployment_strategy/blue_green.rb', line 9 def destroy delete_stack green_stack delete_stack blue_stack end |
#exists? ⇒ Boolean
5 6 7 |
# File 'lib/cf_deployer/deployment_strategy/blue_green.rb', line 5 def exists? green_stack.exists? || blue_stack.exists? end |
#output_value(key) ⇒ Object
15 16 17 |
# File 'lib/cf_deployer/deployment_strategy/blue_green.rb', line 15 def output_value(key) active_stack ? active_stack.output(key) : "The value will be referenced from the output #{key} of undeployed component #{component_name}" end |
#status(get_resource_statuses = false) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cf_deployer/deployment_strategy/blue_green.rb', line 19 def status get_resource_statuses = false my_status = {} [blue_stack, green_stack].each do |the_stack| my_status[the_stack.name] = {} my_status[the_stack.name][:active] = stack_active?(the_stack) my_status[the_stack.name][:status] = the_stack.status my_status[the_stack.name][:resources] = the_stack.resource_statuses if the_stack.exists? && get_resource_statuses end my_status end |