eb_deployer 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.md +10 -0
- data/eb_deployer.gemspec +1 -1
- data/lib/eb_deployer.rb +6 -0
- data/lib/eb_deployer/default_config.yml +10 -1
- data/lib/eb_deployer/eb_environment.rb +4 -3
- data/lib/eb_deployer/version.rb +1 -1
- data/lib/generators/eb_deployer/install/templates/eb_deployer.yml.erb +11 -0
- data/test/aws_driver_stubs.rb +7 -1
- data/test/eb_environment_test.rb +6 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a3bf432fbdd44e7326eaf9e78be738e88e9f3e4
|
4
|
+
data.tar.gz: 2098b1afc36775fde413f58dd89aabd885e12dd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1de31e8970e914b8cea087335e455356294144327b4d905b2ad1f5fe28cbfafb62134b1b2408a8178927f7dfd99880aba589d05092a0b0df7cb9b05fae3fac77
|
7
|
+
data.tar.gz: 3faefb2b6faf8ec5caec1ac861828fe95394f81dce54d4ff94b1cec3b02d7275c86872da33e2908f5206ace6868c3b2fa2a56e4f911b48d675709377ad21660a
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
0.6.5
|
2
|
+
=====
|
3
|
+
|
4
|
+
* #66: Making it possible to specify other accepted health states when deploying (@dziemid)
|
5
|
+
|
6
|
+
0.6.4
|
7
|
+
=====
|
8
|
+
|
9
|
+
* fixes #65 - aws driver should be able to detect CNAME prefixes from both regionalized and legacy EB domains
|
10
|
+
|
1
11
|
0.6.3
|
2
12
|
=====
|
3
13
|
|
data/eb_deployer.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
require File.expand_path('../lib/eb_deployer/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
-
gem.authors = ["wpc", "betarelease"]
|
5
|
+
gem.authors = ["wpc", "betarelease", "xli"]
|
6
6
|
gem.email = ["alex.hal9000@gmail.com", "sudhindra.r.rao@gmail.com", 'swing1979@gmail.com']
|
7
7
|
gem.description = %q{For automating Blue-Green deployment flows on Elastic Beanstalk.}
|
8
8
|
gem.summary = %q{Low friction deployments should be a breeze. Elastic Beanstalk provides a great foundation for performing Blue-Green deployments, and EbDeployer add a missing top to automate the whole flow out of the box.}
|
data/lib/eb_deployer.rb
CHANGED
@@ -91,6 +91,11 @@ module EbDeployer
|
|
91
91
|
# For all available options take a look at
|
92
92
|
# http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html
|
93
93
|
#
|
94
|
+
# @option opts [Symbol] :accepted_healthy_states (['Green']) If :accepted_healthy_states
|
95
|
+
# is specified, EBDeployer will accept provided values when checking
|
96
|
+
# health of an environment instead of default value 'Green'. You can use it
|
97
|
+
# to specify additional healthy states, for example: ['Green', "Yellow"]
|
98
|
+
#
|
94
99
|
# @option opts [Symbol] :phoenix_mode (false) If phoenix mode is turn on, it
|
95
100
|
# will terminate the old elastic beanstalk environment and recreate on
|
96
101
|
# deploy. For blue-green deployment it terminate the inactive environment
|
@@ -204,6 +209,7 @@ module EbDeployer
|
|
204
209
|
:cname_prefix => opts[:cname_prefix],
|
205
210
|
:smoke_test => opts[:smoke_test],
|
206
211
|
:phoenix_mode => opts[:phoenix_mode],
|
212
|
+
:accepted_healthy_states => opts[:accepted_healthy_states],
|
207
213
|
:blue_green_terminate_inactive => opts[:blue_green_terminate_inactive] || false,
|
208
214
|
:blue_green_terminate_inactive_wait => opts[:blue_green_terminate_inactive_wait] || 600,
|
209
215
|
:blue_green_terminate_inactive_sleep => opts[:blue_green_terminate_inactive_sleep] || 15,
|
@@ -83,7 +83,16 @@ common:
|
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
-
|
86
|
+
# List of Elastic Beanstalk health states that will be considered healthy when deploying.
|
87
|
+
# You may want to override default 'Green' with that list, if for example you are using
|
88
|
+
# Elastic Beanstalk worker tier and you don't want eb_deployer to fail if you have messages
|
89
|
+
# in your SQS queue.
|
90
|
+
# By default eb_deployer only considers 'Green' as the healthy state.
|
91
|
+
# For a list of all Elastic Beanstalk health states refer to:
|
92
|
+
# http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.healthstatus.html#using-features.healthstatus.colors
|
93
|
+
# accepted_healthy_states:
|
94
|
+
# - Green
|
95
|
+
# - Yellow
|
87
96
|
|
88
97
|
# Elastic Beanstalk settings that will apply to the environments you are
|
89
98
|
# deploying.
|
@@ -16,6 +16,7 @@ module EbDeployer
|
|
16
16
|
@name = self.class.unique_ebenv_name(name, app)
|
17
17
|
@bs = eb_driver
|
18
18
|
@creation_opts = default_create_options.merge(reject_nil(creation_opts))
|
19
|
+
@accepted_healthy_states = @creation_opts[:accepted_healthy_states]
|
19
20
|
end
|
20
21
|
|
21
22
|
def deploy(version_label, settings={})
|
@@ -162,8 +163,7 @@ module EbDeployer
|
|
162
163
|
def wait_for_env_become_healthy
|
163
164
|
Timeout.timeout(600) do
|
164
165
|
current_health_status = @bs.environment_health_state(@app, @name)
|
165
|
-
|
166
|
-
while current_health_status != 'Green'
|
166
|
+
while !@accepted_healthy_states.include?(current_health_status)
|
167
167
|
log("health status: #{current_health_status}")
|
168
168
|
sleep 15
|
169
169
|
current_health_status = @bs.environment_health_state(@app, @name)
|
@@ -181,7 +181,8 @@ module EbDeployer
|
|
181
181
|
{
|
182
182
|
:solution_stack => "64bit Amazon Linux 2014.09 v1.1.0 running Tomcat 7 Java 7",
|
183
183
|
:smoke_test => Proc.new {},
|
184
|
-
:tier => 'WebServer'
|
184
|
+
:tier => 'WebServer',
|
185
|
+
:accepted_healthy_states => ['Green']
|
185
186
|
}
|
186
187
|
end
|
187
188
|
|
data/lib/eb_deployer/version.rb
CHANGED
@@ -89,6 +89,17 @@ common:
|
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
+
# List of Elastic Beanstalk health states that will be considered healthy when deploying.
|
93
|
+
# You may want to override default 'Green' with that list, if for example you are using
|
94
|
+
# Elastic Beanstalk worker tier and you don't want eb_deployer to fail if you have messages
|
95
|
+
# in your SQS queue.
|
96
|
+
# By default eb_deployer only considers 'Green' as the healthy state.
|
97
|
+
# For a list of all Elastic Beanstalk health states refer to:
|
98
|
+
# http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.healthstatus.html#using-features.healthstatus.colors
|
99
|
+
# accepted_healthy_states:
|
100
|
+
# - Green
|
101
|
+
# - Yellow
|
102
|
+
|
92
103
|
# Elastic Beanstalk settings that will apply to the environments you are
|
93
104
|
# deploying.
|
94
105
|
# For all available options take a look at
|
data/test/aws_driver_stubs.rb
CHANGED
@@ -7,6 +7,7 @@ class EBStub
|
|
7
7
|
@envs_been_deleted = {}
|
8
8
|
@versions_deleted = {}
|
9
9
|
@event_fetched_times = 0
|
10
|
+
@envs_health_states = {}
|
10
11
|
end
|
11
12
|
|
12
13
|
def create_application(app)
|
@@ -166,7 +167,7 @@ class EBStub
|
|
166
167
|
end
|
167
168
|
|
168
169
|
def environment_health_state(app_name, env_name)
|
169
|
-
'Green'
|
170
|
+
@envs_health_states.fetch(app_name+env_name, 'Green')
|
170
171
|
end
|
171
172
|
|
172
173
|
def environment_verion_label(app_name, env_name)
|
@@ -178,6 +179,11 @@ class EBStub
|
|
178
179
|
end
|
179
180
|
|
180
181
|
#test only
|
182
|
+
|
183
|
+
def mark_env_health_state_as(app_name, env_name, state)
|
184
|
+
@envs_health_states[app_name+env_name] = state
|
185
|
+
end
|
186
|
+
|
181
187
|
def mark_all_envs_ready
|
182
188
|
@envs.values.each { |env| set_env_ready(env[:application], env[:name], true) }
|
183
189
|
end
|
data/test/eb_environment_test.rb
CHANGED
@@ -99,5 +99,11 @@ class EbEnvironmentTest < Test::Unit::TestCase
|
|
99
99
|
assert_nil @eb_driver.environment_cname_prefix('myapp', t('production', 'myapp'))
|
100
100
|
end
|
101
101
|
|
102
|
+
def test_should_be_possible_to_accept_yellow_health_state
|
103
|
+
env = EbDeployer::EbEnvironment.new("myapp", "production", @eb_driver, :accepted_healthy_states => ["Green", "Yellow"])
|
104
|
+
@eb_driver.mark_env_health_state_as("myapp", env.name, "Yellow")
|
105
|
+
env.deploy("version1")
|
106
|
+
assert @eb_driver.environment_exists?('myapp', t('production', 'myapp'))
|
107
|
+
end
|
102
108
|
|
103
109
|
end
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eb_deployer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- wpc
|
8
8
|
- betarelease
|
9
|
+
- xli
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2016-
|
13
|
+
date: 2016-02-22 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: aws-sdk
|