engineyard-serverside 2.3.1 → 2.3.2

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTY0OGQwYWRkMDM2MDczMjM3YzQ0YTdlNjgzZjMwOTJhMWFmMTBmYQ==
4
+ ODg5ZGYzMGM2MzIyMmI2ZGYyNTQ3NzY1M2MwOWU3YzMxYjZlNGFjNw==
5
5
  data.tar.gz: !binary |-
6
- OTdiNzFhZDEyNjk2MmU0NWQ5MzNjYjc4MjAxNTI2NDk4ZDQ3YmZjYg==
6
+ N2FkMGZiNzM2MTEwOTRkOTRlZmYxOTJiZmZiM2VlYjNlNWU0ODE2YQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MzBiYzI1NDYxYjAzNjJjZDc2OTg0YzZiZGFmOWExNWJiNjNhNzcxNzFiY2Q4
10
- MDY5NGJlMTE0MTY2YWM2MjdiNjZiNjVjM2FhM2RhZDY0NGI2Y2M1Nzc3NTNi
11
- YzM3NzBkNzI3NDk4M2E5ODc2MGU3YzRhZTk4N2VlM2IxYjcxNGQ=
9
+ MTgyNWI4OGZiMjhlYWM3N2JiY2U0ODRmNTQzZjI4NTRiNDA0NTg3NDM0NmI2
10
+ ODlkMThmZDk5NGU4MjM1OTA3NzUwNzZhNjA0NGY4ZTc1OTkwNzY4ZjYwOTcx
11
+ ZjRjMWM2MTE0ZGVjNWYwMjlhOWM4NmI0MGU5MGRmMDkwMTMxZDQ=
12
12
  data.tar.gz: !binary |-
13
- MjI0MzQwNGQwZGQ3MWVlOGM1ZWEwYzI2YjQ5NjBjYjIxNmI4MDI1MDI1NzVl
14
- NGE5MzU3ZTU4YWEzMTA1NDJiZGZkNmU4MDBiZjJiM2YzODBmYzY5Njg5NDA0
15
- YzlmNzkzMzhhNzA0ZGM3NDNkYmMxMjc2NmFlYzI2NzFhN2ViNjQ=
13
+ NTQ4MDJiMmI3ZDg0MWJkMDZjOThiNGRlNWYzMWNkMzU4NjZiMGNjY2RmYTAw
14
+ MDEwYTcyNTQ0ODYzZTA5OGMzMjc1MmJiOWFkZTBhMDc0NWYyOWE2MDQwN2Qx
15
+ ZDA5OGNjMDQwNThjOTYzYzMyZjhiZDZlMWUwNmQ2Njk0YTQ0YWE=
@@ -33,6 +33,9 @@ module EY
33
33
  method_option :git, :type => :string,
34
34
  :desc => "Remote git repo to deploy"
35
35
 
36
+ method_option :clean, :type => :boolean,
37
+ :desc => "Run deploy without relying on existing files"
38
+
36
39
 
37
40
  account_app_env_options
38
41
  config_option
@@ -108,6 +111,9 @@ module EY
108
111
  # we have to deploy the same SHA there as here
109
112
  integrate_options[:branch] = current_app_dir.join('REVISION').read.strip
110
113
 
114
+ # always rebundle gems on integrate to make sure the instance comes up correctly.
115
+ integrate_options[:clean] = true
116
+
111
117
  init_and_propagate(integrate_options, 'integrate') do |servers, config, shell|
112
118
 
113
119
  # We have to rsync the entire app dir, so we need all the permissions to be correct!
@@ -101,6 +101,7 @@ module EY
101
101
 
102
102
  def_option :restart_groups, 1
103
103
 
104
+ def_boolean_option :clean, false
104
105
  def_boolean_option :verbose, false
105
106
  def_boolean_option :precompile_unchanged_assets, false
106
107
  def_boolean_option :ignore_database_adapter_warning, false
@@ -40,7 +40,7 @@ module EY
40
40
  case enabled
41
41
  when 'false', false then nil
42
42
  when 'true', true then klass.new(servers, config, shell, runner)
43
- when 'detect' then klass.detect(servers, config, shell, runner)
43
+ when 'detect', nil then klass.detect(servers, config, shell, runner)
44
44
  else
45
45
  raise "Unknown value #{enabled.inspect} for option #{name.inspect}. Expected [true, false, detect]"
46
46
  end
@@ -114,12 +114,17 @@ To fix this problem, commit your Gemfile.lock to your repository and redeploy.
114
114
 
115
115
  def clean_bundle_on_system_version_change
116
116
  # diff exits with 0 for same and 1/2 for different/file not found.
117
- check_ruby = "#{config.ruby_version_command} | diff - #{paths.ruby_version} >/dev/null 2>&1"
118
- check_system = "#{config.system_version_command} | diff - #{paths.system_version} >/dev/null 2>&1"
119
117
  clean_bundle = "rm -Rf #{paths.bundled_gems}"
120
118
 
121
- shell.substatus "Checking for system version changes"
122
- run "#{check_ruby} && #{check_system} || #{clean_bundle}"
119
+ if config.clean?
120
+ shell.substatus "Clean bundle forced (--clean)"
121
+ run clean_bundle
122
+ else
123
+ check_ruby = "#{config.ruby_version_command} | diff - #{paths.ruby_version} >/dev/null 2>&1"
124
+ check_system = "#{config.system_version_command} | diff - #{paths.system_version} >/dev/null 2>&1"
125
+ shell.substatus "Checking for system version changes"
126
+ run "#{check_ruby} && #{check_system} || #{clean_bundle}"
127
+ end
123
128
  end
124
129
 
125
130
  def bundler_version
@@ -26,6 +26,7 @@ module EY
26
26
 
27
27
  shell.status "Starting full deploy"
28
28
  copy_repository_cache
29
+ callback(:before_deploy)
29
30
  check_repository
30
31
 
31
32
  with_failed_release_cleanup do
@@ -49,6 +50,7 @@ module EY
49
50
 
50
51
  cleanup_old_releases
51
52
  gc_repository_cache
53
+ callback(:after_deploy)
52
54
  shell.status "Finished deploy at #{Time.now.asctime}"
53
55
  rescue Exception => e
54
56
  shell.status "Finished failing to deploy at #{Time.now.asctime}"
@@ -2,7 +2,7 @@ require 'engineyard-serverside/source'
2
2
 
3
3
  # Deploy source for git repository sourced deploy.
4
4
  class EY::Serverside::Source::Git < EY::Serverside::Source
5
- require_opts :uri, :ref, :repository_cache
5
+ require_opts :ref, :repository_cache
6
6
 
7
7
  def create_revision_file_command(revision_file_path)
8
8
  %Q{#{git} show --pretty=format:"%H" | head -1 > "#{revision_file_path}"}
@@ -1,5 +1,5 @@
1
1
  module EY
2
2
  module Serverside
3
- VERSION = '2.3.1'
3
+ VERSION = '2.3.2'
4
4
  end
5
5
  end
@@ -17,6 +17,7 @@ describe "Deploying a simple application" do
17
17
  args.archive = FIXTURES_DIR.join('retwisj.war')
18
18
  args.verbose = true
19
19
  args.instances = [{ :hostname => "localhost", :roles => ["solo"], :name => "single" }]
20
+ args.serverside_version = Gem::Version.create(EY::Serverside::VERSION.dup).release
20
21
  args.config = {
21
22
  "deploy_to" => deploy_dir,
22
23
  "release_path" => release_path.to_s,
@@ -21,6 +21,8 @@ describe "Deploying an application that uses Bundler" do
21
21
  end
22
22
 
23
23
  it "removes bundled_gems directory if the ruby or system version changed" do
24
+ should_run_clear_bundle_cmd = @deployer.commands.grep(/diff/).first
25
+ should_run_clear_bundle_cmd.should_not be_nil
24
26
  clear_bundle_cmd = @deployer.commands.grep(/rm -Rf \S+\/bundled_gems/).first
25
27
  clear_bundle_cmd.should_not be_nil
26
28
  end
@@ -44,6 +46,20 @@ describe "Deploying an application that uses Bundler" do
44
46
  end
45
47
  end
46
48
 
49
+ context "with clean option" do
50
+ before(:all) do
51
+ deploy_test_application('ey_yml', 'clean' => true)
52
+ end
53
+
54
+ it "removes bundled_gems directory if the ruby or system version changed" do
55
+ should_run_clear_bundle_cmd = @deployer.commands.grep(/diff/).first
56
+ should_run_clear_bundle_cmd.should be_nil
57
+ clear_bundle_cmd = @deployer.commands.grep(/rm -Rf \S+\/bundled_gems/).first
58
+ clear_bundle_cmd.should_not be_nil
59
+ end
60
+
61
+ end
62
+
47
63
  context "with bundler disabled in ey.yml" do
48
64
  before(:all) do
49
65
  deploy_test_application('bundler_disabled')
@@ -7,6 +7,7 @@ describe "deploy hooks" do
7
7
  end
8
8
 
9
9
  it "runs all the hooks" do
10
+ deploy_dir.join('current', 'before_deploy.ran' ).should exist
10
11
  deploy_dir.join('current', 'before_bundle.ran' ).should exist
11
12
  deploy_dir.join('current', 'after_bundle.ran' ).should exist
12
13
  deploy_dir.join('current', 'before_migrate.ran').should exist
@@ -17,6 +18,7 @@ describe "deploy hooks" do
17
18
  deploy_dir.join('current', 'after_symlink.ran' ).should exist
18
19
  deploy_dir.join('current', 'before_restart.ran').should exist
19
20
  deploy_dir.join('current', 'after_restart.ran' ).should exist
21
+ deploy_dir.join('current', 'after_deploy.ran' ).should exist
20
22
  end
21
23
  end
22
24
 
@@ -0,0 +1 @@
1
+ run 'touch after_deploy.ran'
@@ -0,0 +1 @@
1
+ run 'touch before_deploy.ran'
data/spec/spec_helper.rb CHANGED
@@ -251,13 +251,14 @@ exec "$@"
251
251
 
252
252
  # Create the command to send to CLI.start, even though most of the options are ignored
253
253
  @adapter = EY::Serverside::Adapter.new do |args|
254
- args.app = options['app']
255
- args.environment_name = options['environment_name']
256
- args.account_name = options['account_name']
257
- args.migrate = options['migrate']
258
- args.ref = options['branch']
259
- args.git = options['git']
260
- args.config = {
254
+ args.app = options['app']
255
+ args.environment_name = options['environment_name']
256
+ args.account_name = options['account_name']
257
+ args.migrate = options['migrate']
258
+ args.ref = options['branch']
259
+ args.git = options['git']
260
+ args.serverside_version = Gem::Version.create(EY::Serverside::VERSION.dup).release
261
+ args.config = {
261
262
  "services_check_command" => "which echo",
262
263
  "services_setup_command" => "echo 'services setup command'",
263
264
  "source_class" => options["source_class"],
@@ -265,10 +266,11 @@ exec "$@"
265
266
  "release_path" => options["release_path"],
266
267
  "group" => options["group"]
267
268
  }.merge(options['config'] || {})
268
- args.framework_env = options['framework_env']
269
- args.stack = options['stack']
270
- args.verbose = options['verbose']
271
- args.instances = test_servers.map {|s| {:hostname => s.hostname, :roles => s.roles.to_a, :name => s.name} }
269
+ args.framework_env = options['framework_env']
270
+ args.stack = options['stack']
271
+ args.verbose = options['verbose']
272
+ args.clean = options['clean']
273
+ args.instances = test_servers.map {|s| {:hostname => s.hostname, :roles => s.roles.to_a, :name => s.name} }
272
274
  end
273
275
 
274
276
  @argv = @adapter.deploy.commands.last.to_argv[2..-1]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engineyard-serverside
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - EY Cloud Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-02 00:00:00.000000000 Z
11
+ date: 2013-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - ~>
102
102
  - !ruby/object:Gem::Version
103
- version: 2.1.0
103
+ version: 2.2.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ~>
109
109
  - !ruby/object:Gem::Version
110
- version: 2.1.0
110
+ version: 2.2.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: sqlite3
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -331,11 +331,13 @@ files:
331
331
  - spec/fixtures/repos/hook_fails/README
332
332
  - spec/fixtures/repos/hooks/deploy/after_bundle.rb
333
333
  - spec/fixtures/repos/hooks/deploy/after_compile_assets.rb
334
+ - spec/fixtures/repos/hooks/deploy/after_deploy.rb
334
335
  - spec/fixtures/repos/hooks/deploy/after_migrate.rb
335
336
  - spec/fixtures/repos/hooks/deploy/after_restart.rb
336
337
  - spec/fixtures/repos/hooks/deploy/after_symlink.rb
337
338
  - spec/fixtures/repos/hooks/deploy/before_bundle.rb
338
339
  - spec/fixtures/repos/hooks/deploy/before_compile_assets.rb
340
+ - spec/fixtures/repos/hooks/deploy/before_deploy.rb
339
341
  - spec/fixtures/repos/hooks/deploy/before_migrate.rb
340
342
  - spec/fixtures/repos/hooks/deploy/before_restart.rb
341
343
  - spec/fixtures/repos/hooks/deploy/before_symlink.rb
@@ -525,11 +527,13 @@ test_files:
525
527
  - spec/fixtures/repos/hook_fails/README
526
528
  - spec/fixtures/repos/hooks/deploy/after_bundle.rb
527
529
  - spec/fixtures/repos/hooks/deploy/after_compile_assets.rb
530
+ - spec/fixtures/repos/hooks/deploy/after_deploy.rb
528
531
  - spec/fixtures/repos/hooks/deploy/after_migrate.rb
529
532
  - spec/fixtures/repos/hooks/deploy/after_restart.rb
530
533
  - spec/fixtures/repos/hooks/deploy/after_symlink.rb
531
534
  - spec/fixtures/repos/hooks/deploy/before_bundle.rb
532
535
  - spec/fixtures/repos/hooks/deploy/before_compile_assets.rb
536
+ - spec/fixtures/repos/hooks/deploy/before_deploy.rb
533
537
  - spec/fixtures/repos/hooks/deploy/before_migrate.rb
534
538
  - spec/fixtures/repos/hooks/deploy/before_restart.rb
535
539
  - spec/fixtures/repos/hooks/deploy/before_symlink.rb