Class: EbDeployer::Environment
- Inherits:
-
Object
- Object
- EbDeployer::Environment
- Includes:
- Utils
- Defined in:
- lib/eb_deployer/environment.rb
Constant Summary
Constants included from Utils
Instance Attribute Summary collapse
-
#component_under_deploy ⇒ Object
writeonly
Sets the attribute component_under_deploy.
-
#creation_opts ⇒ Object
Returns the value of attribute creation_opts.
-
#inactive_settings ⇒ Object
writeonly
Sets the attribute inactive_settings.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#resource_stacks ⇒ Object
writeonly
Sets the attribute resource_stacks.
-
#settings ⇒ Object
writeonly
Sets the attribute settings.
-
#strategy_name ⇒ Object
Returns the value of attribute strategy_name.
Instance Method Summary collapse
- #app_name ⇒ Object
- #components=(components_attrs) ⇒ Object
- #deploy(version_label) ⇒ Object
-
#initialize(app, name, stack_name, eb_driver) {|_self| ... } ⇒ Environment
constructor
A new instance of Environment.
Methods included from Utils
#backoff, #reject_nil, #symbolize_keys
Constructor Details
#initialize(app, name, stack_name, eb_driver) {|_self| ... } ⇒ Environment
Returns a new instance of Environment.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/eb_deployer/environment.rb', line 10 def initialize(app, name, stack_name, eb_driver, &block) @app = app @name = name @stack_name = stack_name @eb_driver = eb_driver @creation_opts = {} @settings = [] @inactive_settings = [] @strategy_name = :blue_green @components = nil yield(self) if block_given? unless @components @components = [DefaultComponent.new(self, @creation_opts, @strategy_name, @eb_driver)] end end |
Instance Attribute Details
#component_under_deploy=(value) ⇒ Object (writeonly)
Sets the attribute component_under_deploy
6 7 8 |
# File 'lib/eb_deployer/environment.rb', line 6 def component_under_deploy=(value) @component_under_deploy = value end |
#creation_opts ⇒ Object
Returns the value of attribute creation_opts.
4 5 6 |
# File 'lib/eb_deployer/environment.rb', line 4 def creation_opts @creation_opts end |
#inactive_settings=(value) ⇒ Object (writeonly)
Sets the attribute inactive_settings
6 7 8 |
# File 'lib/eb_deployer/environment.rb', line 6 def inactive_settings=(value) @inactive_settings = value end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/eb_deployer/environment.rb', line 8 def name @name end |
#resource_stacks=(value) ⇒ Object (writeonly)
Sets the attribute resource_stacks
6 7 8 |
# File 'lib/eb_deployer/environment.rb', line 6 def resource_stacks=(value) @resource_stacks = value end |
#settings=(value) ⇒ Object (writeonly)
Sets the attribute settings
6 7 8 |
# File 'lib/eb_deployer/environment.rb', line 6 def settings=(value) @settings = value end |
#strategy_name ⇒ Object
Returns the value of attribute strategy_name.
4 5 6 |
# File 'lib/eb_deployer/environment.rb', line 4 def strategy_name @strategy_name end |
Instance Method Details
#app_name ⇒ Object
26 27 28 |
# File 'lib/eb_deployer/environment.rb', line 26 def app_name @app.name end |
#components=(components_attrs) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/eb_deployer/environment.rb', line 37 def components=(components_attrs) return unless components_attrs @components = components_attrs.map do |attrs| attrs = symbolize_keys(attrs) Component.new(attrs.delete(:name), self, attrs, @eb_driver) end end |
#deploy(version_label) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/eb_deployer/environment.rb', line 30 def deploy(version_label) resource_settings = @resource_stacks.provision(@stack_name) components_to_deploy.each do |component| component.deploy(version_label, @settings + resource_settings, @inactive_settings) end end |