ey-deploy 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,6 +16,7 @@ require 'server'
16
16
  require 'deploy'
17
17
  require 'deploy_hook'
18
18
  require 'lockfile_parser'
19
+ require 'bundle_installer'
19
20
  require 'cli'
20
21
  require 'configuration'
21
22
 
@@ -0,0 +1,4 @@
1
+ module EY
2
+ class BundleInstaller < Struct.new(:version, :options)
3
+ end
4
+ end
@@ -122,16 +122,16 @@ module EY
122
122
  info "~> Gemfile detected, bundling gems"
123
123
  lockfile = File.join(c.release_path, "Gemfile.lock")
124
124
 
125
- bundler_version = if File.exist?(lockfile)
126
- get_bundler_version(lockfile)
127
- else
128
- warn_about_missing_lockfile
129
- DEFAULT_09_BUNDLER
130
- end
125
+ bundler_installer = if File.exist?(lockfile)
126
+ get_bundler_installer(lockfile)
127
+ else
128
+ warn_about_missing_lockfile
129
+ DEFAULT_09_BUNDLER
130
+ end
131
131
 
132
- sudo "#{$0} _#{VERSION}_ install_bundler #{bundler_version}"
132
+ sudo "#{$0} _#{VERSION}_ install_bundler #{bundler_installer.version}"
133
133
 
134
- run "cd #{c.release_path} && bundle _#{bundler_version}_ install --without=development --without=test"
134
+ run "cd #{c.release_path} && bundle _#{bundler_installer.version}_ install #{bundler_installer.options}"
135
135
  end
136
136
  end
137
137
 
@@ -269,7 +269,7 @@ module EY
269
269
  end
270
270
 
271
271
  DEFAULT_09_BUNDLER = '0.9.26'
272
- DEFAULT_10_BUNDLER = '1.0.0.rc.1'
272
+ DEFAULT_10_BUNDLER = '1.0.0.rc.3'
273
273
 
274
274
  def warn_about_missing_lockfile
275
275
  info "!>"
@@ -285,19 +285,23 @@ module EY
285
285
  info "!>"
286
286
  end
287
287
 
288
- def get_bundler_version(lockfile)
288
+ def get_bundler_installer(lockfile)
289
289
  parser = LockfileParser.new(File.read(lockfile))
290
- return parser.bundler_version if parser.bundler_version
291
290
  case parser.lockfile_version
292
291
  when :bundler09
293
- DEFAULT_09_BUNDLER
292
+ BundleInstaller.new(
293
+ parser.bundler_version || DEFAULT_09_BUNDLER,
294
+ "--without=development --without=test")
294
295
  when :bundler10
295
- DEFAULT_10_BUNDLER
296
+ BundleInstaller.new(
297
+ parser.bundler_version || DEFAULT_10_BUNDLER,
298
+ "--deployment --path #{c.shared_path}/bundled_gems"
299
+ )
296
300
  else
297
301
  raise "Unknown lockfile version #{parser.lockfile_version}"
298
302
  end
299
303
  end
300
- public :get_bundler_version
304
+ public :get_bundler_installer
301
305
 
302
306
  end # DeployBase
303
307
 
@@ -1,3 +1,3 @@
1
1
  module EY
2
- VERSION = '1.0.2'
2
+ VERSION = '1.1.0'
3
3
  end
@@ -3,7 +3,8 @@ 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
- EY::DeployBase.new({}).get_bundler_version(full_path)
6
+ config = EY::Deploy::Configuration.new('deploy_to' => 'dontcare')
7
+ EY::DeployBase.new(config).get_bundler_installer(full_path).version
7
8
  end
8
9
 
9
10
  it "returns the default version for an 0.9 lockfile without a bundler dependency" do
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
+ - 1
8
9
  - 0
9
- - 2
10
- version: 1.0.2
10
+ version: 1.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - EY Cloud Team
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-29 00:00:00 -07:00
18
+ date: 2010-08-04 00:00:00 -07:00
19
19
  default_executable: ey-deploy
20
20
  dependencies: []
21
21
 
@@ -29,6 +29,7 @@ extra_rdoc_files: []
29
29
 
30
30
  files:
31
31
  - bin/ey-deploy
32
+ - lib/ey-deploy/bundle_installer.rb
32
33
  - lib/ey-deploy/cli.rb
33
34
  - lib/ey-deploy/configuration.rb
34
35
  - lib/ey-deploy/default_maintenance_page.html
@@ -234,7 +235,6 @@ files:
234
235
  - LICENSE
235
236
  - spec/custom_deploy_spec.rb
236
237
  - spec/deploy_hook_spec.rb
237
- - spec/fixtures/gitrepo/bar
238
238
  - spec/fixtures/gitrepo/foo
239
239
  - spec/fixtures/gitrepo.tar.gz
240
240
  - spec/fixtures/invalid_hook.rb
@@ -284,7 +284,6 @@ summary: A gem that deploys ruby applications on EY Cloud instances
284
284
  test_files:
285
285
  - spec/custom_deploy_spec.rb
286
286
  - spec/deploy_hook_spec.rb
287
- - spec/fixtures/gitrepo/bar
288
287
  - spec/fixtures/gitrepo/foo
289
288
  - spec/fixtures/gitrepo.tar.gz
290
289
  - spec/fixtures/invalid_hook.rb
File without changes