Class: EbDeployer::DeploymentStrategy::BlueGreen
- Inherits:
-
Object
- Object
- EbDeployer::DeploymentStrategy::BlueGreen
- Defined in:
- lib/eb_deployer/deployment_strategy/blue_green.rb
Instance Method Summary collapse
- #deploy(version_label, env_settings, inactive_settings = []) ⇒ Object
-
#initialize(env) ⇒ BlueGreen
constructor
A new instance of BlueGreen.
- #test_compatibility(env_create_options) ⇒ Object
Constructor Details
#initialize(env) ⇒ BlueGreen
Returns a new instance of BlueGreen.
4 5 6 |
# File 'lib/eb_deployer/deployment_strategy/blue_green.rb', line 4 def initialize(env) @env = env end |
Instance Method Details
#deploy(version_label, env_settings, inactive_settings = []) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/eb_deployer/deployment_strategy/blue_green.rb', line 15 def deploy(version_label, env_settings, inactive_settings=[]) if !ebenvs.any?(&method(:active_ebenv?)) ebenv('a', @env.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) active_ebenv.swap_cname_with(inactive_ebenv) unless inactive_settings.empty? active_ebenv.log("applying inactive settings...") active_ebenv.apply_settings(inactive_settings) end end |
#test_compatibility(env_create_options) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/eb_deployer/deployment_strategy/blue_green.rb', line 8 def test_compatibility() tier = [:tier] if tier && tier.downcase == 'worker' raise "Blue green deployment is not supported for Worker tier" end end |