engineyard-serverside 1.2.0 → 1.2.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.
@@ -44,6 +44,10 @@ module EY
44
44
  end
45
45
  end
46
46
 
47
+ def to_json
48
+ configuration.to_json
49
+ end
50
+
47
51
  def node
48
52
  EY.node
49
53
  end
@@ -126,7 +126,7 @@ module EY
126
126
  get_bundler_installer(lockfile)
127
127
  else
128
128
  warn_about_missing_lockfile
129
- BundleInstaller.new(DEFAULT_09_BUNDLER, "--without=development --without=test")
129
+ BundleInstaller.new(default_09_bundler, "--without=development --without=test")
130
130
  end
131
131
 
132
132
  sudo "#{$0} _#{VERSION}_ install_bundler #{bundler_installer.version}"
@@ -220,13 +220,19 @@ module EY
220
220
  def callback(what)
221
221
  @callbacks_reached ||= true
222
222
  if File.exist?("#{c.release_path}/deploy/#{what}.rb")
223
- eydeploy_path = $0 # invoke others just like we were invoked
224
- run "#{eydeploy_path} _#{VERSION}_ hook '#{what}' --app '#{config.app}' --release-path #{config.release_path}" do |server, cmd|
225
- cmd << " --framework-env '#{c.environment}'"
226
- cmd << " --current-role '#{server.role}'"
227
- cmd << " --current-name '#{server.name}'" if server.name
228
- cmd << " --config '#{c[:config]}'" if c.has_key?(:config)
229
- cmd
223
+ base_command = [$0, "_#{VERSION}_", 'hook', what.to_s,
224
+ '--app', config.app.to_s,
225
+ '--release-path', config.release_path.to_s,
226
+ ]
227
+
228
+ run Escape.shell_command(base_command) do |server, cmd|
229
+ per_instance_args = [
230
+ '--framework-env', c.environment.to_s,
231
+ '--current-role', server.role.to_s,
232
+ '--config', c.to_json,
233
+ ]
234
+ per_instance_args << '--current-name' << server.name.to_s if server.name
235
+ cmd << " " << Escape.shell_command(per_instance_args)
230
236
  end
231
237
  end
232
238
  end
@@ -268,9 +274,6 @@ module EY
268
274
  sudo "rm -rf #{c.release_path}"
269
275
  end
270
276
 
271
- DEFAULT_09_BUNDLER = '0.9.26'
272
- DEFAULT_10_BUNDLER = '1.0.0.rc.3'
273
-
274
277
  def warn_about_missing_lockfile
275
278
  info "!>"
276
279
  info "!> WARNING: Gemfile.lock is missing!"
@@ -281,7 +284,7 @@ module EY
281
284
  info "!> Fix this by running \"git add Gemfile.lock; git commit\" and deploying again."
282
285
  info "!> If you don't have a Gemfile.lock, run \"bundle lock\" to create one."
283
286
  info "!>"
284
- info "!> This deployment will use bundler #{DEFAULT_09_BUNDLER} to run 'bundle install'."
287
+ info "!> This deployment will use bundler #{default_09_bundler} to run 'bundle install'."
285
288
  info "!>"
286
289
  end
287
290
 
@@ -290,11 +293,11 @@ module EY
290
293
  case parser.lockfile_version
291
294
  when :bundler09
292
295
  BundleInstaller.new(
293
- parser.bundler_version || DEFAULT_09_BUNDLER,
296
+ parser.bundler_version || default_09_bundler,
294
297
  "--without=development --without=test")
295
298
  when :bundler10
296
299
  BundleInstaller.new(
297
- parser.bundler_version || DEFAULT_10_BUNDLER,
300
+ parser.bundler_version || default_10_bundler,
298
301
  "--deployment --path #{c.shared_path}/bundled_gems --without development test"
299
302
  )
300
303
  else
@@ -303,6 +306,9 @@ module EY
303
306
  end
304
307
  public :get_bundler_installer
305
308
 
309
+ def default_09_bundler() "0.9.26" end
310
+ def default_10_bundler() "1.0.0.rc.6" end
311
+
306
312
  end # DeployBase
307
313
 
308
314
  class Deploy < DeployBase
@@ -57,9 +57,6 @@ module EY
57
57
  # convenience functions for running on certain instance types
58
58
  def on_app_master(&blk) on_roles(%w[solo app_master], &blk) end
59
59
  def on_app_servers(&blk) on_roles(%w[solo app_master app], &blk) end
60
- def on_db_master(&blk) on_roles(%w[solo db_master], &blk) end
61
- def on_db_slaves(&blk) on_roles(%w[db_slave], &blk) end
62
- def on_db_servers(&blk) on_roles(%w[solo db_master db_slave], &blk) end
63
60
  def on_app_servers_and_utilities(&blk) on_roles(%w[solo app_master app util], &blk) end
64
61
 
65
62
  def on_utilities(*names, &blk)
@@ -1,3 +1,3 @@
1
1
  module EY
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
3
3
  end
@@ -0,0 +1,3 @@
1
+ module EY
2
+ VERSION = '1.2.1'
3
+ end
@@ -157,18 +157,6 @@ describe "the deploy-hook API" do
157
157
  where_code_runs_with(:on_app_servers).should == %w(solo app_master app)
158
158
  end
159
159
 
160
- it "#on_db_master runs on DB masters and solos" do
161
- where_code_runs_with(:on_db_master).should == %w(solo db_master)
162
- end
163
-
164
- it "#on_db_slaves runs on DB slaves only (not solos or masters)" do
165
- where_code_runs_with(:on_db_slaves).should == %w(db_slave)
166
- end
167
-
168
- it "#on_db_servers runs on DB masters, DB slaves, and solos" do
169
- where_code_runs_with(:on_db_servers).should == %w(solo db_master db_slave)
170
- end
171
-
172
160
  it "#on_app_servers_and_utilities does what it says on the tin" do
173
161
  where_code_runs_with(:on_app_servers_and_utilities).should ==
174
162
  %w(solo app_master app util_alpha util_beta util_gamma)
@@ -3,12 +3,12 @@ require File.dirname(__FILE__) + '/spec_helper'
3
3
  describe "the bundler version retrieved from the lockfile" do
4
4
  def get_version(file)
5
5
  full_path = File.expand_path("../support/lockfiles/#{file}", __FILE__)
6
- config = EY::Deploy::Configuration.new('deploy_to' => 'dontcare')
7
- EY::DeployBase.new(config).get_bundler_installer(full_path).version
6
+ @config = EY::Deploy::Configuration.new('deploy_to' => 'dontcare')
7
+ EY::DeployBase.new(@config).get_bundler_installer(full_path).version
8
8
  end
9
9
 
10
10
  it "returns the default version for an 0.9 lockfile without a bundler dependency" do
11
- get_version('0.9-no-bundler').should == EY::DeployBase::DEFAULT_09_BUNDLER
11
+ get_version('0.9-no-bundler').should == EY::DeployBase.new(@config).send(:default_09_bundler)
12
12
  end
13
13
 
14
14
  it "gets the version from an 0.9 lockfile with a bundler dependency" do
@@ -16,7 +16,7 @@ describe "the bundler version retrieved from the lockfile" do
16
16
  end
17
17
 
18
18
  it "returns the default version for a 1.0 lockfile without a bundler dependency" do
19
- get_version('1.0-no-bundler').should == EY::DeployBase::DEFAULT_10_BUNDLER
19
+ get_version('1.0-no-bundler').should == EY::DeployBase.new(@config).send(:default_10_bundler)
20
20
  end
21
21
 
22
22
  it "gets the version from a 1.0.0.rc.1 lockfile w/dependency on 1.0.0.rc.1" do
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engineyard-serverside
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 29
4
5
  prerelease: false
5
6
  segments:
6
7
  - 1
7
8
  - 2
8
- - 0
9
- version: 1.2.0
9
+ - 1
10
+ version: 1.2.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - EY Cloud Team
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-08-16 00:00:00 -07:00
18
+ date: 2010-08-25 00:00:00 -07:00
18
19
  default_executable: engineyard-serverside
19
20
  dependencies: []
20
21
 
@@ -40,6 +41,7 @@ files:
40
41
  - lib/engineyard-serverside/strategies/git.rb
41
42
  - lib/engineyard-serverside/task.rb
42
43
  - lib/engineyard-serverside/version.rb
44
+ - lib/engineyard-serverside/version_flymake.rb
43
45
  - lib/engineyard-serverside.rb
44
46
  - lib/vendor/dataflow/dataflow/actor.rb
45
47
  - lib/vendor/dataflow/dataflow/equality.rb
@@ -232,8 +234,22 @@ files:
232
234
  - lib/vendor/thor/thor.gemspec
233
235
  - lib/vendor/thor/Thorfile
234
236
  - LICENSE
237
+ - spec/custom_deploy_spec.rb
238
+ - spec/deploy_hook_spec.rb
239
+ - spec/fixtures/gitrepo/foo
240
+ - spec/fixtures/gitrepo.tar.gz
241
+ - spec/fixtures/invalid_hook.rb
242
+ - spec/fixtures/valid_hook.rb
243
+ - spec/git_strategy_spec.rb
244
+ - spec/lockfile_parser_spec.rb
245
+ - spec/spec_helper.rb
246
+ - spec/support/lockfiles/0.9-no-bundler
247
+ - spec/support/lockfiles/0.9-with-bundler
248
+ - spec/support/lockfiles/1.0-no-bundler
249
+ - spec/support/lockfiles/1.0.0.rc.1-with-bundler
250
+ - spec/support/lockfiles/not-a-lockfile
235
251
  has_rdoc: true
236
- homepage: http://engineyard.com
252
+ homepage: http://github.com/engineyard/engineyard-serverside
237
253
  licenses: []
238
254
 
239
255
  post_install_message:
@@ -242,23 +258,27 @@ rdoc_options: []
242
258
  require_paths:
243
259
  - lib
244
260
  required_ruby_version: !ruby/object:Gem::Requirement
261
+ none: false
245
262
  requirements:
246
263
  - - ">="
247
264
  - !ruby/object:Gem::Version
265
+ hash: 3
248
266
  segments:
249
267
  - 0
250
268
  version: "0"
251
269
  required_rubygems_version: !ruby/object:Gem::Requirement
270
+ none: false
252
271
  requirements:
253
272
  - - ">="
254
273
  - !ruby/object:Gem::Version
274
+ hash: 3
255
275
  segments:
256
276
  - 0
257
277
  version: "0"
258
278
  requirements: []
259
279
 
260
280
  rubyforge_project:
261
- rubygems_version: 1.3.6
281
+ rubygems_version: 1.3.7
262
282
  signing_key:
263
283
  specification_version: 3
264
284
  summary: A gem that deploys ruby applications on EY Cloud instances