engineyard-serverside 1.5.12 → 1.5.13.servicespike
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/engineyard-serverside/deploy.rb +8 -16
- data/lib/engineyard-serverside/version.rb +1 -1
- data/spec/services_deploy_spec.rb +9 -39
- data/spec/support/integration.rb +6 -18
- metadata +17 -30
@@ -4,13 +4,6 @@ require 'fileutils'
|
|
4
4
|
require 'json'
|
5
5
|
require 'engineyard-serverside/rails_asset_support'
|
6
6
|
|
7
|
-
begin
|
8
|
-
require 'ey_instance_api_client'
|
9
|
-
rescue LoadError
|
10
|
-
puts "Using Ruby #{RUBY_VERSION}"
|
11
|
-
# engineyard-serverside SOMETIMES runs under the system ruby instead of resin ruby
|
12
|
-
end
|
13
|
-
|
14
7
|
module EY
|
15
8
|
module Serverside
|
16
9
|
class DeployBase < Task
|
@@ -36,7 +29,7 @@ module EY
|
|
36
29
|
with_failed_release_cleanup do
|
37
30
|
create_revision_file
|
38
31
|
run_with_callbacks(:bundle)
|
39
|
-
|
32
|
+
setup_services
|
40
33
|
symlink_configs
|
41
34
|
conditionally_enable_maintenance_page
|
42
35
|
run_with_callbacks(:migrate)
|
@@ -267,16 +260,15 @@ WRAP
|
|
267
260
|
run create_revision_file_command
|
268
261
|
end
|
269
262
|
|
270
|
-
def
|
271
|
-
|
263
|
+
def services_setup_command
|
264
|
+
"sudo /usr/local/ey_resin/ruby/bin/ey-services-setup #{config.app}"
|
272
265
|
end
|
273
266
|
|
274
|
-
def
|
275
|
-
info "~>
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
end
|
267
|
+
def setup_services
|
268
|
+
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
|
280
272
|
rescue StandardError => e
|
281
273
|
warning <<-WARNING
|
282
274
|
External services configuration not updated. Using previous version.
|
@@ -38,18 +38,18 @@ describe "Deploying an application with services" do
|
|
38
38
|
@symlinked_services_file = @deploy_dir.join('current', 'config', 'ey_services_config_deploy.yml')
|
39
39
|
|
40
40
|
@deployer = setup_deploy
|
41
|
-
@deployer.
|
41
|
+
@deployer.mock_services_setup!("echo 'somefilecontents' > #{@shared_services_file}")
|
42
42
|
@deployer.deploy
|
43
43
|
end
|
44
44
|
|
45
45
|
it "creates and symlinks ey_services_config_deploy.yml" do
|
46
46
|
@shared_services_file.should exist
|
47
47
|
@shared_services_file.should_not be_symlink
|
48
|
-
@shared_services_file.read.should ==
|
48
|
+
@shared_services_file.read.should == "somefilecontents\n"
|
49
49
|
|
50
50
|
@symlinked_services_file.should exist
|
51
51
|
@symlinked_services_file.should be_symlink
|
52
|
-
@shared_services_file.read.should ==
|
52
|
+
@shared_services_file.read.should == "somefilecontents\n"
|
53
53
|
|
54
54
|
@deployer.infos.should_not be_any { |info| info =~ /WARNING/ }
|
55
55
|
end
|
@@ -57,18 +57,18 @@ describe "Deploying an application with services" do
|
|
57
57
|
describe "followed by a deploy that fails to fetch services" do
|
58
58
|
before do
|
59
59
|
@deployer = setup_deploy
|
60
|
-
@deployer.
|
60
|
+
@deployer.mock_services_setup_to_break!
|
61
61
|
@deployer.deploy
|
62
62
|
end
|
63
63
|
|
64
64
|
it "logs a warning and symlinks the existing config file" do
|
65
65
|
@shared_services_file.should exist
|
66
66
|
@shared_services_file.should_not be_symlink
|
67
|
-
@shared_services_file.read.should ==
|
67
|
+
@shared_services_file.read.should == "somefilecontents\n"
|
68
68
|
|
69
69
|
@symlinked_services_file.should exist
|
70
70
|
@symlinked_services_file.should be_symlink
|
71
|
-
@shared_services_file.read.should ==
|
71
|
+
@shared_services_file.read.should == "somefilecontents\n"
|
72
72
|
|
73
73
|
@deployer.infos.should be_any { |info| info =~ /WARNING: External services configuration not updated/ }
|
74
74
|
end
|
@@ -78,18 +78,18 @@ describe "Deploying an application with services" do
|
|
78
78
|
describe "followed by another successfull deploy" do
|
79
79
|
before do
|
80
80
|
@deployer = setup_deploy
|
81
|
-
@deployer.
|
81
|
+
@deployer.mock_services_setup!("echo 'otherfilecontents' > #{@shared_services_file}")
|
82
82
|
@deployer.deploy
|
83
83
|
end
|
84
84
|
|
85
85
|
it "replaces the config with the new one (and symlinks)" do
|
86
86
|
@shared_services_file.should exist
|
87
87
|
@shared_services_file.should_not be_symlink
|
88
|
-
@shared_services_file.read.should ==
|
88
|
+
@shared_services_file.read.should == "otherfilecontents\n"
|
89
89
|
|
90
90
|
@symlinked_services_file.should exist
|
91
91
|
@symlinked_services_file.should be_symlink
|
92
|
-
@shared_services_file.read.should ==
|
92
|
+
@shared_services_file.read.should == "otherfilecontents\n"
|
93
93
|
|
94
94
|
@deployer.infos.should_not be_any { |info| info =~ /WARNING/ }
|
95
95
|
end
|
@@ -98,34 +98,4 @@ describe "Deploying an application with services" do
|
|
98
98
|
|
99
99
|
end
|
100
100
|
|
101
|
-
|
102
|
-
# it "creates and symlinks ey_services_config_deploy.yml" do
|
103
|
-
# shared_services_file = @deploy_dir.join('shared', 'config', 'ey_services_config_deploy.yml')
|
104
|
-
# symlinked_services_file = @deploy_dir.join('current', 'config', 'ey_services_config_deploy.yml')
|
105
|
-
#
|
106
|
-
# @deployer.deploy
|
107
|
-
#
|
108
|
-
# shared_services_file.should exist
|
109
|
-
# shared_services_file.should_not be_symlink
|
110
|
-
#
|
111
|
-
# symlinked_services_file.should exist
|
112
|
-
# symlinked_services_file.should be_symlink
|
113
|
-
# end
|
114
|
-
#
|
115
|
-
# it "prints a warning if it couldn't access the services api" do
|
116
|
-
# @deployer.deploy
|
117
|
-
#
|
118
|
-
# shared_services_file = @deploy_dir.join('shared', 'config', 'ey_services_config_deploy.yml')
|
119
|
-
# symlinked_services_file = @deploy_dir.join('current', 'config', 'ey_services_config_deploy.yml')
|
120
|
-
#
|
121
|
-
# @deployer.services_fetcher_breaks!
|
122
|
-
# @deployer.deploy
|
123
|
-
#
|
124
|
-
#
|
125
|
-
# shared_services_file.should exist
|
126
|
-
# shared_services_file.should_not be_symlink
|
127
|
-
#
|
128
|
-
# symlinked_services_file.should exist
|
129
|
-
# symlinked_services_file.should be_symlink
|
130
|
-
# end
|
131
101
|
end
|
data/spec/support/integration.rb
CHANGED
@@ -10,13 +10,11 @@ class FullTestDeploy < EY::Serverside::Deploy
|
|
10
10
|
|
11
11
|
# stfu
|
12
12
|
def info(msg)
|
13
|
-
puts msg
|
14
13
|
@infos << msg
|
15
14
|
end
|
16
15
|
|
17
16
|
# no really, stfu
|
18
17
|
def debug(msg)
|
19
|
-
puts msg
|
20
18
|
@debugs << msg
|
21
19
|
end
|
22
20
|
|
@@ -70,26 +68,16 @@ class FullTestDeploy < EY::Serverside::Deploy
|
|
70
68
|
super
|
71
69
|
end
|
72
70
|
|
73
|
-
|
74
|
-
|
75
|
-
@block = block
|
76
|
-
end
|
77
|
-
|
78
|
-
def get(app)
|
79
|
-
@block.call(app)
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
def services_fetcher
|
84
|
-
@mock_fetcher ||= MockFetcher.new { |app| {"some_service_for_#{app}" => {"some_var" => 'some_value'}} }
|
71
|
+
def services_setup_command
|
72
|
+
@mock_services_setup_command || "echo 'skipped'"
|
85
73
|
end
|
86
74
|
|
87
|
-
def
|
88
|
-
@
|
75
|
+
def mock_services_setup!(value)
|
76
|
+
@mock_services_setup_command = value
|
89
77
|
end
|
90
78
|
|
91
|
-
def
|
92
|
-
@
|
79
|
+
def mock_services_setup_to_break!
|
80
|
+
@mock_services_setup_command = "notarealcommandsoitwillexitnonzero"
|
93
81
|
end
|
94
82
|
end
|
95
83
|
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: engineyard-serverside
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 740994330
|
5
|
+
prerelease: 7
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
|
9
|
+
- 13
|
10
|
+
- servicespike
|
11
|
+
version: 1.5.13.servicespike
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- EY Cloud Team
|
@@ -15,28 +16,12 @@ autorequire:
|
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
17
18
|
|
18
|
-
date: 2011-11-
|
19
|
+
date: 2011-11-03 00:00:00 Z
|
19
20
|
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
name: ey_instance_api_client
|
22
|
-
prerelease: false
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
-
none: false
|
25
|
-
requirements:
|
26
|
-
- - "="
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 17
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
- 1
|
32
|
-
- 5
|
33
|
-
version: 0.1.5
|
34
|
-
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
21
|
- !ruby/object:Gem::Dependency
|
37
22
|
name: rspec
|
38
23
|
prerelease: false
|
39
|
-
requirement: &
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
40
25
|
none: false
|
41
26
|
requirements:
|
42
27
|
- - "="
|
@@ -48,11 +33,11 @@ dependencies:
|
|
48
33
|
- 2
|
49
34
|
version: 1.3.2
|
50
35
|
type: :development
|
51
|
-
version_requirements: *
|
36
|
+
version_requirements: *id001
|
52
37
|
- !ruby/object:Gem::Dependency
|
53
38
|
name: rake
|
54
39
|
prerelease: false
|
55
|
-
requirement: &
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
56
41
|
none: false
|
57
42
|
requirements:
|
58
43
|
- - ">="
|
@@ -62,7 +47,7 @@ dependencies:
|
|
62
47
|
- 0
|
63
48
|
version: "0"
|
64
49
|
type: :development
|
65
|
-
version_requirements: *
|
50
|
+
version_requirements: *id002
|
66
51
|
description:
|
67
52
|
email: cloud@engineyard.com
|
68
53
|
executables:
|
@@ -330,16 +315,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
330
315
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
331
316
|
none: false
|
332
317
|
requirements:
|
333
|
-
- - "
|
318
|
+
- - ">"
|
334
319
|
- !ruby/object:Gem::Version
|
335
|
-
hash:
|
320
|
+
hash: 25
|
336
321
|
segments:
|
337
|
-
-
|
338
|
-
|
322
|
+
- 1
|
323
|
+
- 3
|
324
|
+
- 1
|
325
|
+
version: 1.3.1
|
339
326
|
requirements: []
|
340
327
|
|
341
328
|
rubyforge_project:
|
342
|
-
rubygems_version: 1.8.
|
329
|
+
rubygems_version: 1.8.10
|
343
330
|
signing_key:
|
344
331
|
specification_version: 3
|
345
332
|
summary: A gem that deploys ruby applications on EY Cloud instances
|