Class: EbDeployer::DeploymentStrategy::BlueOnly

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

Instance Method Summary collapse

Constructor Details

#initialize(component) ⇒ BlueOnly

Returns a new instance of BlueOnly.



4
5
6
# File 'lib/eb_deployer/deployment_strategy/blue_only.rb', line 4

def initialize(component)
  @component = component
end

Instance Method Details

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



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/eb_deployer/deployment_strategy/blue_only.rb', line 15

def deploy(version_label, env_settings, inactive_settings=[])
  if !ebenvs.any?(&method(:active_ebenv?))
    ebenv('a', @component.cname_prefix).
      deploy(version_label, env_settings)
    return
  end

  active_ebenv = ebenvs.detect(&method(:active_ebenv?))
  inactive_ebenv = ebenvs.reject(&method(:active_ebenv?)).first

  inactive_ebenv.deploy(version_label, env_settings)
end

#test_compatibility(env_create_options) ⇒ Object



8
9
10
11
12
13
# File 'lib/eb_deployer/deployment_strategy/blue_only.rb', line 8

def test_compatibility(env_create_options)
  tier = env_create_options[:tier]
  if tier && tier.downcase == 'worker'
    raise "Blue only deployment is not supported for Worker tier"
  end
end