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.
-
#components ⇒ Object
writeonly
Sets the attribute components.
-
#creation_opts ⇒ Object
writeonly
Sets the attribute creation_opts.
-
#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
writeonly
Sets the attribute strategy_name.
Instance Method Summary collapse
- #app_name ⇒ Object
- #deploy(version_label) ⇒ Object
-
#initialize(app, name, eb_driver) {|_self| ... } ⇒ Environment
constructor
A new instance of Environment.
Methods included from Utils
Constructor Details
#initialize(app, name, eb_driver) {|_self| ... } ⇒ Environment
Returns a new instance of Environment.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/eb_deployer/environment.rb', line 8 def initialize(app, name, eb_driver, &block) @app = app @name = name @eb_driver = eb_driver @creation_opts = {} @settings = [] @strategy_name = :blue_green 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
5 6 7 |
# File 'lib/eb_deployer/environment.rb', line 5 def component_under_deploy=(value) @component_under_deploy = value end |
#components=(components_attrs) ⇒ Object (writeonly)
Sets the attribute components
5 6 7 |
# File 'lib/eb_deployer/environment.rb', line 5 def components=(value) @components = value end |
#creation_opts=(value) ⇒ Object (writeonly)
Sets the attribute creation_opts
5 6 7 |
# File 'lib/eb_deployer/environment.rb', line 5 def creation_opts=(value) @creation_opts = value end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/eb_deployer/environment.rb', line 6 def name @name end |
#resource_stacks=(value) ⇒ Object (writeonly)
Sets the attribute resource_stacks
5 6 7 |
# File 'lib/eb_deployer/environment.rb', line 5 def resource_stacks=(value) @resource_stacks = value end |
#settings=(value) ⇒ Object (writeonly)
Sets the attribute settings
5 6 7 |
# File 'lib/eb_deployer/environment.rb', line 5 def settings=(value) @settings = value end |
#strategy_name=(value) ⇒ Object (writeonly)
Sets the attribute strategy_name
5 6 7 |
# File 'lib/eb_deployer/environment.rb', line 5 def strategy_name=(value) @strategy_name = value end |
Instance Method Details
#app_name ⇒ Object
21 22 23 |
# File 'lib/eb_deployer/environment.rb', line 21 def app_name @app.name end |
#deploy(version_label) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/eb_deployer/environment.rb', line 25 def deploy(version_label) resource_settings = @resource_stacks.provision(resource_stack_name) components_to_deploy.each do |component| component.deploy(version_label, @settings + resource_settings) end end |