Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply inactive settings when termination fails #110

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
0.7.1
=====

* apply inactive settings to not terminated black instance

0.7.0
=====

Expand Down
19 changes: 4 additions & 15 deletions lib/eb_deployer/deployment_strategy/blue_green.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,11 @@ def deploy(version_label, env_settings, inactive_settings=[])

if blue_green_terminate_inactive
active_ebenv.log("Waiting #{blue_green_terminate_inactive_wait}s before terminating environment...")

sleep 120

# Loop until timeout reached or environment becomes Red
count = 0
loop do
break if count >= blue_green_terminate_inactive_wait or inactive_ebenv.health_state != 'Green'
sleep blue_green_terminate_inactive_sleep
count += blue_green_terminate_inactive_sleep
end

if inactive_ebenv.health_state == 'Green'
active_ebenv.log("Active environment healthy, terminating inactive (black) environment")
active_ebenv.terminate
else
active_ebenv.log("Active environment changed state to unhealthy. Existing (black) environment will not be terminated")
end

active_ebenv.log("terminating inactive (black) environment")
active_ebenv.terminate
end

unless inactive_settings.empty? || blue_green_terminate_inactive
Expand Down
2 changes: 1 addition & 1 deletion lib/eb_deployer/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module EbDeployer
VERSION = "0.7.0"
VERSION = "0.7.2"
end