engineyard-serverside 1.5.13.servicespike → 1.5.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -260,15 +260,23 @@ WRAP
260
260
  run create_revision_file_command
261
261
  end
262
262
 
263
+ def services_command_check
264
+ "which /usr/local/ey_resin/ruby/bin/ey-services-setup"
265
+ end
266
+
263
267
  def services_setup_command
264
- "sudo /usr/local/ey_resin/ruby/bin/ey-services-setup #{config.app}"
268
+ "/usr/local/ey_resin/ruby/bin/ey-services-setup #{config.app}"
265
269
  end
266
270
 
267
271
  def setup_services
268
272
  info "~> Setting up external services."
269
- puts "running command: " + services_setup_command.inspect
270
- result = run(services_setup_command)
271
- puts "command result: " + result.inspect
273
+ begin
274
+ sudo(services_command_check)
275
+ rescue StandardError => e
276
+ info "Could not setup services. Upgrade your environment to get services configuration."
277
+ return
278
+ end
279
+ sudo(services_setup_command)
272
280
  rescue StandardError => e
273
281
  warning <<-WARNING
274
282
  External services configuration not updated. Using previous version.
@@ -1,5 +1,5 @@
1
1
  module EY
2
2
  module Serverside
3
- VERSION = '1.5.13.servicespike'
3
+ VERSION = '1.5.13'
4
4
  end
5
5
  end
@@ -51,14 +51,4 @@ describe "Deploying an application without Bundler" do
51
51
  @deploy_dir.join('current', 'after_restart.ran' ).should exist
52
52
  end
53
53
 
54
- it "creates and symlinks ey_services_config_deploy.yml" do
55
- shared_services_file = @deploy_dir.join('shared', 'config', 'ey_services_config_deploy.yml')
56
- symlinked_services_file = @deploy_dir.join('current', 'config', 'ey_services_config_deploy.yml')
57
-
58
- shared_services_file.should exist
59
- shared_services_file.should_not be_symlink
60
-
61
- symlinked_services_file.should exist
62
- symlinked_services_file.should be_symlink
63
- end
64
54
  end
@@ -23,6 +23,7 @@ describe "the EY::Serverside::Deploy API" do
23
23
  def copy_repository_cache() @call_order << 'copy_repository_cache' end
24
24
  def create_revision_file() @call_order << 'create_revision_file' end
25
25
  def bundle() @call_order << 'bundle' end
26
+ def setup_services() @call_order << 'setup_services' end
26
27
  def symlink_configs() @call_order << 'symlink_configs' end
27
28
  def migrate() @call_order << 'migrate' end
28
29
  def compile_assets() @call_order << 'compile_assets' end
@@ -40,6 +41,7 @@ describe "the EY::Serverside::Deploy API" do
40
41
  copy_repository_cache
41
42
  create_revision_file
42
43
  bundle
44
+ setup_services
43
45
  symlink_configs
44
46
  conditionally_enable_maintenance_page
45
47
  migrate
@@ -54,10 +54,31 @@ describe "Deploying an application with services" do
54
54
  @deployer.infos.should_not be_any { |info| info =~ /WARNING/ }
55
55
  end
56
56
 
57
+ describe "followed by a deploy that can't find the command" do
58
+ before do
59
+ @deployer = setup_deploy
60
+ @deployer.mock_services_command_check!("which nonexistatncommand")
61
+ @deployer.deploy
62
+ end
63
+
64
+ it "silently fails" do
65
+ @shared_services_file.should exist
66
+ @shared_services_file.should_not be_symlink
67
+ @shared_services_file.read.should == "somefilecontents\n"
68
+
69
+ @symlinked_services_file.should exist
70
+ @symlinked_services_file.should be_symlink
71
+ @shared_services_file.read.should == "somefilecontents\n"
72
+
73
+ @deployer.infos.should_not be_any { |info| info =~ /WARNING/ }
74
+ end
75
+
76
+ end
77
+
57
78
  describe "followed by a deploy that fails to fetch services" do
58
79
  before do
59
80
  @deployer = setup_deploy
60
- @deployer.mock_services_setup_to_break!
81
+ @deployer.mock_services_setup!("notarealcommandsoitwillexitnonzero")
61
82
  @deployer.deploy
62
83
  end
63
84
 
@@ -68,6 +68,14 @@ class FullTestDeploy < EY::Serverside::Deploy
68
68
  super
69
69
  end
70
70
 
71
+ def services_command_check
72
+ @mock_services_command_check || "which echo"
73
+ end
74
+
75
+ def mock_services_command_check!(value)
76
+ @mock_services_command_check = value
77
+ end
78
+
71
79
  def services_setup_command
72
80
  @mock_services_setup_command || "echo 'skipped'"
73
81
  end
@@ -76,9 +84,6 @@ class FullTestDeploy < EY::Serverside::Deploy
76
84
  @mock_services_setup_command = value
77
85
  end
78
86
 
79
- def mock_services_setup_to_break!
80
- @mock_services_setup_command = "notarealcommandsoitwillexitnonzero"
81
- end
82
87
  end
83
88
 
84
89
  module EY::Serverside::Strategies::IntegrationSpec
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engineyard-serverside
3
3
  version: !ruby/object:Gem::Version
4
- hash: 740994330
5
- prerelease: 7
4
+ hash: 25
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 5
9
9
  - 13
10
- - servicespike
11
- version: 1.5.13.servicespike
10
+ version: 1.5.13
12
11
  platform: ruby
13
12
  authors:
14
13
  - EY Cloud Team
@@ -16,12 +15,10 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2011-11-03 00:00:00 Z
18
+ date: 2011-11-07 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
- name: rspec
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
21
+ version_requirements: &id001 !ruby/object:Gem::Requirement
25
22
  none: false
26
23
  requirements:
27
24
  - - "="
@@ -32,12 +29,12 @@ dependencies:
32
29
  - 3
33
30
  - 2
34
31
  version: 1.3.2
32
+ requirement: *id001
35
33
  type: :development
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: rake
39
34
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
35
+ name: rspec
36
+ - !ruby/object:Gem::Dependency
37
+ version_requirements: &id002 !ruby/object:Gem::Requirement
41
38
  none: false
42
39
  requirements:
43
40
  - - ">="
@@ -46,8 +43,10 @@ dependencies:
46
43
  segments:
47
44
  - 0
48
45
  version: "0"
46
+ requirement: *id002
49
47
  type: :development
50
- version_requirements: *id002
48
+ prerelease: false
49
+ name: rake
51
50
  description:
52
51
  email: cloud@engineyard.com
53
52
  executables:
@@ -315,14 +314,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
315
314
  required_rubygems_version: !ruby/object:Gem::Requirement
316
315
  none: false
317
316
  requirements:
318
- - - ">"
317
+ - - ">="
319
318
  - !ruby/object:Gem::Version
320
- hash: 25
319
+ hash: 3
321
320
  segments:
322
- - 1
323
- - 3
324
- - 1
325
- version: 1.3.1
321
+ - 0
322
+ version: "0"
326
323
  requirements: []
327
324
 
328
325
  rubyforge_project: