Class: EbDeployer::DefaultComponent

Inherits:
Object
  • Object
show all
Defined in:
lib/eb_deployer/default_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(env, creation_opts, strategy_name, eb_driver) ⇒ DefaultComponent

Returns a new instance of DefaultComponent.



3
4
5
6
7
8
# File 'lib/eb_deployer/default_component.rb', line 3

def initialize(env, creation_opts, strategy_name, eb_driver)
  @env = env
  @eb_driver = eb_driver
  @creation_opts = creation_opts
  @strategy = DeploymentStrategy.create(self, strategy_name)
end

Instance Method Details

#cname_prefixObject



10
11
12
# File 'lib/eb_deployer/default_component.rb', line 10

def cname_prefix
  @creation_opts[:cname_prefix] || default_cname_prefix
end

#deploy(version_label, eb_settings, inactive_settings = []) ⇒ Object



14
15
16
17
# File 'lib/eb_deployer/default_component.rb', line 14

def deploy(version_label, eb_settings, inactive_settings=[])
  @strategy.test_compatibility(@creation_opts)
  @strategy.deploy(version_label, eb_settings, inactive_settings)
end

#new_eb_env(suffix = nil, cname_prefix_overriding = nil) ⇒ Object



19
20
21
22
23
24
# File 'lib/eb_deployer/default_component.rb', line 19

def new_eb_env(suffix=nil, cname_prefix_overriding=nil)
  EbEnvironment.new(@env.app_name,
                    [@env.name, suffix].compact.join('-'),
                    @eb_driver,
                    @creation_opts.merge(:cname_prefix => cname_prefix_overriding || cname_prefix))
end