Class: EbDeployer::Environment

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/eb_deployer/environment.rb

Constant Summary

Constants included from Utils

Utils::BACKOFF_INITIAL_SLEEP

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

#backoff, #symbolize_keys

Constructor Details

#initialize(app, name, eb_driver) {|_self| ... } ⇒ Environment

Returns a new instance of Environment.

Yields:

  • (_self)

Yield Parameters:



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

Parameters:

  • value —

    the value to set the attribute component_under_deploy to.



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

Parameters:

  • value —

    the value to set the attribute components to.



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

Parameters:

  • value —

    the value to set the attribute creation_opts to.



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

Parameters:

  • value —

    the value to set the attribute resource_stacks to.



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

Parameters:

  • value —

    the value to set the attribute settings to.



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

Parameters:

  • value —

    the value to set the attribute strategy_name to.



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