Class: EbDeployer::Component
- Inherits:
-
Object
- Object
- EbDeployer::Component
- Defined in:
- lib/eb_deployer/component.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #cname_prefix ⇒ Object
- #deploy(version_label, eb_settings, inactive_settings = []) ⇒ Object
-
#initialize(name, env, options, eb_driver) ⇒ Component
constructor
A new instance of Component.
- #new_eb_env(suffix = nil, cname_prefix_overriding = nil) ⇒ Object
Constructor Details
#initialize(name, env, options, eb_driver) ⇒ Component
Returns a new instance of Component.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/eb_deployer/component.rb', line 5 def initialize(name, env, , eb_driver) @name = name @env = env @eb_driver = eb_driver @options = .dup @component_eb_settings = @options.delete(:option_settings) || [] @component_inactive_settings = @options.delete(:inactive_settings) || [] strategy_name = @options[:strategy] || @env.strategy_name @strategy = DeploymentStrategy.create(self, strategy_name) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/eb_deployer/component.rb', line 3 def name @name end |
Instance Method Details
#cname_prefix ⇒ Object
16 17 18 |
# File 'lib/eb_deployer/component.rb', line 16 def cname_prefix @options[:cname_prefix] || default_cname_prefix end |
#deploy(version_label, eb_settings, inactive_settings = []) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/eb_deployer/component.rb', line 20 def deploy(version_label, eb_settings, inactive_settings=[]) @strategy.test_compatibility() @strategy.deploy(version_label, eb_settings + @component_eb_settings, inactive_settings + @component_inactive_settings) end |
#new_eb_env(suffix = nil, cname_prefix_overriding = nil) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/eb_deployer/component.rb', line 27 def new_eb_env(suffix=nil, cname_prefix_overriding=nil) EbEnvironment.new(@env.app_name, [@env.name, @name, suffix].compact.join('-'), @eb_driver, .merge(:cname_prefix => cname_prefix_overriding || cname_prefix)) end |