Module: CfDeployer::DeploymentStrategy

Defined in:
lib/cf_deployer/deployment_strategy/base.rb,
lib/cf_deployer/deployment_strategy/blue_green.rb,
lib/cf_deployer/deployment_strategy/cname_swap.rb,
lib/cf_deployer/deployment_strategy/create_or_update.rb,
lib/cf_deployer/deployment_strategy/auto_scaling_group_swap.rb

Defined Under Namespace

Classes: AutoScalingGroupSwap, Base, BlueGreen, CnameSwap, CreateOrUpdate

Class Method Summary collapse

Class Method Details

.create(application_name, environment_name, component_name, context) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/cf_deployer/deployment_strategy/base.rb', line 4

def self.create application_name, environment_name, component_name, context
  context[:'deployment-strategy'] ||= 'create-or-update'
  strategy_class_name = 'CfDeployer::DeploymentStrategy::' + context[:'deployment-strategy'].split('-').map(&:capitalize).join
  begin
    eval(strategy_class_name).new  application_name, component_name, environment_name, context
  rescue
    raise ApplicationError.new 'strategy_name: ' + strategy_class_name + ' not supported'
  end
end