Class: CfDeployer::DeploymentStrategy::BlueGreen
- Inherits:
-
Base
- Object
- Base
- CfDeployer::DeploymentStrategy::BlueGreen
show all
- Defined in:
- lib/cf_deployer/deployment_strategy/blue_green.rb
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
Methods inherited from Base
#active_template, #blue_green_strategy?, #initialize, #run_hook
Instance Method Details
#destroy ⇒ Object
9
10
11
12
13
|
# File 'lib/cf_deployer/deployment_strategy/blue_green.rb', line 9
def destroy
delete_stack green_stack
delete_stack blue_stack
destroy_post
end
|
#destroy_post ⇒ Object
15
16
17
|
# File 'lib/cf_deployer/deployment_strategy/blue_green.rb', line 15
def destroy_post
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
19
20
21
|
# File 'lib/cf_deployer/deployment_strategy/blue_green.rb', line 19
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
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/cf_deployer/deployment_strategy/blue_green.rb', line 23
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
|