elastic-beanstalk 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -78,10 +78,10 @@ This will take a while. We intend to provide an example in the wiki and/or samp
78
78
  rake eb:package # Package zip source bundle for Elastic Beanstalk
79
79
  rake eb:show_config[version] # Show resolved configuration without doing anything
80
80
 
81
- ## RDS Rake Tasks
81
+ ## EB:RDS Rake Tasks
82
82
 
83
- RDS tasks are intended to make integration of RDS task into the deployment process simple.
84
- i.e. create a snapshot before or after an `eb:deploy`, the following `rake` tasks exist:
83
+ The EB:RDS tasks are intended to make integration of RDS tasks into the deployment process simple.
84
+ i.e. create a snapshot before or after an `eb:deploy`. The following rake tasks exist:
85
85
 
86
86
  rake eb:rds:create_snapshot[instance_id,snapshot_id] # Creates an RDS snapshot
87
87
  rake eb:rds:instances # List RDS instances
@@ -36,4 +36,5 @@ Gem::Specification.new do |spec|
36
36
  spec.add_runtime_dependency 'time_diff'
37
37
  spec.add_runtime_dependency 'zipruby'
38
38
  spec.add_runtime_dependency 'table_print'
39
+ spec.add_runtime_dependency 'nokogiri'
39
40
  end
@@ -1,6 +1,7 @@
1
1
  require 'timeout'
2
2
  require 'net/http'
3
3
  require 'elastic/beanstalk/spinner'
4
+ require 'nokogiri'
4
5
 
5
6
  module Elastic
6
7
  module Beanstalk
@@ -31,8 +32,14 @@ module Elastic
31
32
  response = ResponseStub.new({code: e.message, body: ''})
32
33
  end
33
34
 
34
- #puts "\t\t[#{response.code}]"
35
+ puts "\t\t[#{response.code}]"
35
36
  #puts "\t#{response.body}"
37
+
38
+ #
39
+ # Let's try to get out quickly when the deploy has gone wrong.
40
+ #
41
+ break if received_fatal_error?(response)
42
+
36
43
  end until (!response.nil? && response.code.to_i == 200 && response.body.include?(expected_text))
37
44
  }
38
45
  end
@@ -44,6 +51,36 @@ module Elastic
44
51
 
45
52
  private
46
53
 
54
+ def received_fatal_error?(response)
55
+ fatal_error = false
56
+ ['Bundler::PathError'].each do |code|
57
+ # fail right away on known terminal cases.
58
+ if (!response.nil? && response.code.to_i == 500 && response.body.include?(code))
59
+
60
+ doc = Nokogiri::HTML(response.body)
61
+
62
+ $stderr.puts "\t\t[#{response.code}] #{code}"
63
+ $stderr.puts "\t\t\t#{get_content(doc, '//h1')}"
64
+ $stderr.puts "\t\t\t#{get_content(doc, '//dl/dd')}"
65
+ fatal_error = true
66
+ break
67
+ end
68
+ end
69
+
70
+ fatal_error
71
+ end
72
+
73
+ def get_content(doc, xpath)
74
+ value = ''
75
+ begin
76
+ element = doc.xpath(xpath)
77
+ element = element.first unless element.nil?
78
+ value = element.content unless element.nil?
79
+ rescue
80
+ end
81
+ value
82
+ end
83
+
47
84
  class ResponseStub
48
85
 
49
86
  attr_reader :code, :body
@@ -11,7 +11,7 @@ require 'timeout'
11
11
  namespace :eb do
12
12
 
13
13
  namespace :rds do
14
-
14
+ # http://docs.aws.amazon.com/AWSRubySDK/latest/frames.html
15
15
  desc 'List RDS snapshots'
16
16
  task :snapshots => [:config] do |t, args|
17
17
  # absolutely do not run this without specifying columns, otherwise it will call all defined methods including :delete
@@ -106,7 +106,6 @@ namespace :eb do
106
106
  {engine: lambda { |i| "#{i.engine} #{i.engine_version}" }},
107
107
  {zone: {display_method: :availability_zone_name}},
108
108
  :multi_az,
109
- #{endpoint_address: {max_width: 120}},
110
109
  {:endpoint_address => {:width => 120}},
111
110
  {port: {display_method: :endpoint_port}},
112
111
  #:latest_restorable_time,
@@ -1,5 +1,5 @@
1
1
  module Elastic
2
2
  module Beanstalk
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
5
5
  end
@@ -2,10 +2,11 @@ require 'spec_helper'
2
2
 
3
3
  describe EbExtensions do
4
4
 
5
- ##this is a driver only, perhaps make this a reasonable test someday...
5
+
6
+ ###this is a driver only, perhaps make this a reasonable test someday...
6
7
  #it "#test_url" do
7
8
  # #url = 'http://acme-development-inactive.elasticbeanstalk.com/ping'
8
- # url = 'http://google.com'
9
+ # #url = 'http://google.com'
9
10
  # expected_text = 'You came to this page by mistake, go back where you came from'
10
11
  # EbSmokeTester.test_url(url, 10, 2, expected_text)
11
12
  #end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic-beanstalk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-11 00:00:00.000000000 Z
12
+ date: 2013-09-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -155,6 +155,22 @@ dependencies:
155
155
  - - ! '>='
156
156
  - !ruby/object:Gem::Version
157
157
  version: '0'
158
+ - !ruby/object:Gem::Dependency
159
+ name: nokogiri
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ type: :runtime
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
158
174
  description: ! ' The simplest way to configure and deploy an Elastic Beanstalk
159
175
  application via rake.
160
176