Class: CfDeployer::DeploymentStrategy::Base
- Inherits:
-
Object
- Object
- CfDeployer::DeploymentStrategy::Base
- Defined in:
- lib/cf_deployer/deployment_strategy/base.rb
Direct Known Subclasses
Constant Summary collapse
- BLUE_GREEN_STRATEGY =
true
Instance Attribute Summary collapse
-
#application_name ⇒ Object
readonly
Returns the value of attribute application_name.
-
#component_name ⇒ Object
readonly
Returns the value of attribute component_name.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#environment_name ⇒ Object
readonly
Returns the value of attribute environment_name.
Instance Method Summary collapse
- #active_template ⇒ Object
- #blue_green_strategy? ⇒ Boolean
-
#initialize(application_name, component_name, environment_name, context) ⇒ Base
constructor
A new instance of Base.
- #run_hook(hook_name) ⇒ Object
Constructor Details
#initialize(application_name, component_name, environment_name, context) ⇒ Base
Returns a new instance of Base.
18 19 20 21 22 23 24 |
# File 'lib/cf_deployer/deployment_strategy/base.rb', line 18 def initialize(application_name, component_name, environment_name, context) @application_name = application_name @component_name = component_name @environment_name = environment_name @context = context @auto_scaling_group_drivers = {} end |
Instance Attribute Details
#application_name ⇒ Object (readonly)
Returns the value of attribute application_name.
17 18 19 |
# File 'lib/cf_deployer/deployment_strategy/base.rb', line 17 def application_name @application_name end |
#component_name ⇒ Object (readonly)
Returns the value of attribute component_name.
17 18 19 |
# File 'lib/cf_deployer/deployment_strategy/base.rb', line 17 def component_name @component_name end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
17 18 19 |
# File 'lib/cf_deployer/deployment_strategy/base.rb', line 17 def context @context end |
#environment_name ⇒ Object (readonly)
Returns the value of attribute environment_name.
17 18 19 |
# File 'lib/cf_deployer/deployment_strategy/base.rb', line 17 def environment_name @environment_name end |
Instance Method Details
#active_template ⇒ Object
45 46 47 48 |
# File 'lib/cf_deployer/deployment_strategy/base.rb', line 45 def active_template target_stack = ( active_stack || stack ) (target_stack && target_stack.exists?) ? target_stack.template : nil end |
#blue_green_strategy? ⇒ Boolean
26 27 28 |
# File 'lib/cf_deployer/deployment_strategy/base.rb', line 26 def blue_green_strategy? BLUE_GREEN_STRATEGY end |
#run_hook(hook_name) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/cf_deployer/deployment_strategy/base.rb', line 30 def run_hook(hook_name) CfDeployer::Driver::DryRun.guard "Skipping hook #{hook_name}" do unless @params_and_outputs_resolved target_stack = ( active_stack || stack ) unless target_stack.exists? CfDeployer::Log.info "Skipping hook call for #{hook_name} since stack #{target_stack.name} doesn't exist." return end get_parameters_outputs target_stack end hook = Hook.new hook_name, context[hook_name] hook.run context end end |