eb_deployer 0.4.4.beta2 → 0.4.4.beta3

Sign up to get free protection for your applications and to get access to all the features.
@@ -95,13 +95,15 @@ module EbDeployer
95
95
  end
96
96
 
97
97
  def environment_cname(app_name, env_name)
98
- env = alive_envs(app_name, [env_name]).first
99
- env && env[:cname]
98
+ get_environment_attribute(app_name, env_name, :cname)
100
99
  end
101
100
 
102
101
  def environment_health_state(app_name, env_name)
103
- env = alive_envs(app_name, [env_name]).first
104
- env && env[:health]
102
+ get_environment_attribute(app_name, env_name, :health)
103
+ end
104
+
105
+ def environment_verion_label(app_name, env_name)
106
+ get_environment_attribute(app_name, env_name, :version_label)
105
107
  end
106
108
 
107
109
  def environment_swap_cname(app_name, env1, env2)
@@ -117,6 +119,11 @@ module EbDeployer
117
119
  {:name=>"WebServer", :type=>"Standard", :version=>"1.0"}
118
120
  ]
119
121
 
122
+ def get_environment_attribute(app_name, env_name, attribute)
123
+ env = alive_envs(app_name, [env_name]).first
124
+ env && env[:attribute]
125
+ end
126
+
120
127
  def environment_tier(name)
121
128
  TIERS.find {|t| t[:name].downcase == name.downcase} || raise("No tier found with name #{name.inspect}")
122
129
  end
@@ -31,7 +31,8 @@ module EbDeployer
31
31
 
32
32
  def apply_settings(settings)
33
33
  raise "Env #{self.name} not exists for applying settings" unless @bs.environment_exists?(@app, @name)
34
- update_eb_env(settings)
34
+ version_label = @bs.environment_verion_label(@app, @name)
35
+ update_eb_env(settings, version_label)
35
36
  end
36
37
 
37
38
  def cname_prefix
@@ -63,7 +64,7 @@ module EbDeployer
63
64
  end
64
65
  end
65
66
 
66
- def update_eb_env(settings, version_label=nil)
67
+ def update_eb_env(settings, version_label)
67
68
  with_polling_events(/Environment update completed successfully/i) do
68
69
  @bs.update_environment(@app, @name, version_label, @creation_opts[:tier], settings)
69
70
  end
@@ -1,3 +1,3 @@
1
1
  module EbDeployer
2
- VERSION = "0.4.4.beta2"
2
+ VERSION = "0.4.4.beta3"
3
3
  end
@@ -111,11 +111,12 @@ class EBStub
111
111
  'Green'
112
112
  end
113
113
 
114
- #test only
115
114
  def environment_verion_label(app_name, env_name)
116
115
  @envs[env_key(app_name, env_name)][:version]
117
116
  end
118
117
 
118
+ #test only
119
+
119
120
  def environment_tier(app_name, env_name)
120
121
  @envs[env_key(app_name, env_name)][:tier]
121
122
  end
@@ -76,14 +76,23 @@ class BlueGreenDeployTest < DeployTest
76
76
 
77
77
  do_deploy(42, settings)
78
78
  assert_equal 10, @eb.environment_settings('simple', t('production-a', 'simple')).last[:value]
79
+ assert_equal '42', @eb.environment_verion_label('simple', t('production-a', 'simple'))
79
80
 
80
81
  do_deploy(43, settings)
81
82
  assert_equal 1, @eb.environment_settings('simple', t('production-a', 'simple')).last[:value]
83
+ assert_equal '42', @eb.environment_verion_label('simple', t('production-a', 'simple'))
84
+
82
85
  assert_equal 10, @eb.environment_settings('simple', t('production-b', 'simple')).last[:value]
86
+ assert_equal '43', @eb.environment_verion_label('simple', t('production-b', 'simple'))
87
+
83
88
 
84
89
  do_deploy(44, settings)
85
90
  assert_equal 10, @eb.environment_settings('simple', t('production-a', 'simple')).last[:value]
91
+ assert_equal '44', @eb.environment_verion_label('simple', t('production-a', 'simple'))
92
+
86
93
  assert_equal 1, @eb.environment_settings('simple', t('production-b', 'simple')).last[:value]
94
+ assert_equal '43', @eb.environment_verion_label('simple', t('production-b', 'simple'))
95
+
87
96
  end
88
97
 
89
98
  private
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eb_deployer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4.beta2
4
+ version: 0.4.4.beta3
5
+ prerelease: 6
5
6
  platform: ruby
6
7
  authors:
7
8
  - wpc
@@ -14,6 +15,7 @@ dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: aws-sdk
16
17
  requirement: !ruby/object:Gem::Requirement
18
+ none: false
17
19
  requirements:
18
20
  - - ! '>='
19
21
  - !ruby/object:Gem::Version
@@ -21,6 +23,7 @@ dependencies:
21
23
  type: :runtime
22
24
  prerelease: false
23
25
  version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
24
27
  requirements:
25
28
  - - ! '>='
26
29
  - !ruby/object:Gem::Version
@@ -85,26 +88,27 @@ files:
85
88
  homepage: https://github.com/ThoughtWorksStudios/eb_deployer
86
89
  licenses:
87
90
  - MIT
88
- metadata: {}
89
91
  post_install_message:
90
92
  rdoc_options: []
91
93
  require_paths:
92
94
  - lib
93
95
  required_ruby_version: !ruby/object:Gem::Requirement
96
+ none: false
94
97
  requirements:
95
98
  - - ! '>='
96
99
  - !ruby/object:Gem::Version
97
100
  version: '0'
98
101
  required_rubygems_version: !ruby/object:Gem::Requirement
102
+ none: false
99
103
  requirements:
100
104
  - - ! '>'
101
105
  - !ruby/object:Gem::Version
102
106
  version: 1.3.1
103
107
  requirements: []
104
108
  rubyforge_project:
105
- rubygems_version: 2.2.0
109
+ rubygems_version: 1.8.23
106
110
  signing_key:
107
- specification_version: 4
111
+ specification_version: 3
108
112
  summary: Low friction deployments should be a breeze. Elastic Beanstalk provides a
109
113
  great foundation for performing Blue-Green deployments, and EbDeployer add a missing
110
114
  top to automate the whole flow out of the box.
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MGZjMmMyZmZjOTQwMDA3ZGMzNWViZGZmY2I0ZWRlMTlhODFmY2VlYw==
5
- data.tar.gz: !binary |-
6
- ZWNmNmQyMWViYWQ4MmZkNGEyZjgyZThkNDAzNDBiYmJlYjRhYzIwMw==
7
- SHA512:
8
- metadata.gz: !binary |-
9
- ZWYxMzg3ZDgxZWIyOTZkZTg2MTlhZjUyMmRmMDExYTRlZDllYmExN2FjNDZl
10
- YWY5M2FmYjExYTUwMWQ2ZTg4YmI5ZmQ2ZDNmMTVlNWZmODhlZmNhNDU4NzZj
11
- NmUyZmFjODE4YmI2MzQ4NTQyZjg0ODU5YmE4YTQ1Y2NiNGQ1OWQ=
12
- data.tar.gz: !binary |-
13
- YzU2NmQ2MjJjODhiNzk2Y2ZkNDZhZTBhOTU5NDg4OTg3YWFiZjJmMGJjMjcz
14
- NTFmNjI1N2JlNzljYWU2NjkxNjFkMmJiNzE1YjI0Y2FhN2NhYzk3OWJhMzEz
15
- MTNlNDVjNDE5YWViMWQ1ZmNkY2E1MjczYTI1MzUzYTk2ODAwMTQ=