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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1dfbd8d4f385399972ca9ee421f054ea8644ae9
4
- data.tar.gz: ff4d16c027d33272e6d6a6fb2a08bb869aa74847
3
+ metadata.gz: 8a3bf432fbdd44e7326eaf9e78be738e88e9f3e4
4
+ data.tar.gz: 2098b1afc36775fde413f58dd89aabd885e12dd3
5
5
  SHA512:
6
- metadata.gz: 46de86d6c03d0e4f8c37578194d8965c78c1a88296c3f28e48f1186ccef65bd52eacbe3153d413d959f4eaacb50be7bb2ad2c0af8cc3bb0c71fddc25c99c1ab6
7
- data.tar.gz: e0cad16af0d8a1b3bac871a2a6ac200b10b1ad33ed653abdd3f72d2a99af27725fd7af220fbffefbdb765b4ba63bc95eb5fab4b8e000ec5f94ed4c41ad42fd42
6
+ metadata.gz: 1de31e8970e914b8cea087335e455356294144327b4d905b2ad1f5fe28cbfafb62134b1b2408a8178927f7dfd99880aba589d05092a0b0df7cb9b05fae3fac77
7
+ data.tar.gz: 3faefb2b6faf8ec5caec1ac861828fe95394f81dce54d4ff94b1cec3b02d7275c86872da33e2908f5206ace6868c3b2fa2a56e4f911b48d675709377ad21660a
@@ -4,6 +4,8 @@ rvm:
4
4
  - 2.1.6
5
5
  - 2.2.2
6
6
  - jruby-1.7.10
7
+ before_install:
8
+ - gem install bundler
7
9
  script: "bundle exec rake"
8
10
  bundler_args: "--without repl documentation"
9
11
  branches:
@@ -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
 
@@ -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.}
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module EbDeployer
2
- VERSION = "0.6.4"
2
+ VERSION = "0.6.5"
3
3
  end
@@ -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
@@ -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
@@ -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
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-01-26 00:00:00.000000000 Z
13
+ date: 2016-02-22 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: aws-sdk