engineyard-serverside 2.7.8pre2 → 2.8.0.pre
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.
- data/bin/engineyard-serverside +1 -1
- data/bin/engineyard-serverside-execute-hook +1 -1
- data/bin/engineyard-serverside-execute-service-hook +35 -0
- data/lib/engineyard-serverside.rb +0 -1
- data/lib/engineyard-serverside/about.rb +11 -8
- data/lib/engineyard-serverside/callbacks.rb +11 -0
- data/lib/engineyard-serverside/callbacks/collection.rb +17 -0
- data/lib/engineyard-serverside/callbacks/collection/base.rb +79 -0
- data/lib/engineyard-serverside/callbacks/collection/combined.rb +45 -0
- data/lib/engineyard-serverside/callbacks/collection/deploy_hooks.rb +21 -0
- data/lib/engineyard-serverside/callbacks/collection/service_hooks.rb +17 -0
- data/lib/engineyard-serverside/callbacks/collection/service_hooks/collection.rb +24 -0
- data/lib/engineyard-serverside/callbacks/collection/service_hooks/combined.rb +40 -0
- data/lib/engineyard-serverside/callbacks/distributor.rb +21 -0
- data/lib/engineyard-serverside/callbacks/distributor/remote.rb +76 -0
- data/lib/engineyard-serverside/callbacks/distributor/viability_filter.rb +66 -0
- data/lib/engineyard-serverside/callbacks/executor.rb +23 -0
- data/lib/engineyard-serverside/callbacks/executor/base.rb +44 -0
- data/lib/engineyard-serverside/callbacks/executor/executable.rb +123 -0
- data/lib/engineyard-serverside/callbacks/executor/ruby.rb +20 -0
- data/lib/engineyard-serverside/callbacks/executor/ruby/context.rb +81 -0
- data/lib/engineyard-serverside/callbacks/executor/ruby/executor.rb +118 -0
- data/{spec/fixtures/gitrepo/bar → lib/engineyard-serverside/callbacks/hooks.rb} +0 -0
- data/lib/engineyard-serverside/callbacks/hooks/app.rb +21 -0
- data/lib/engineyard-serverside/callbacks/hooks/base.rb +43 -0
- data/lib/engineyard-serverside/callbacks/hooks/service.rb +28 -0
- data/lib/engineyard-serverside/callbacks/service_hook.rb +20 -0
- data/lib/engineyard-serverside/cli.rb +4 -225
- data/lib/engineyard-serverside/cli/app.rb +136 -0
- data/lib/engineyard-serverside/cli/helpers.rb +58 -0
- data/lib/engineyard-serverside/cli/server_hash_extractor.rb +49 -0
- data/lib/engineyard-serverside/cli/workflows.rb +45 -0
- data/lib/engineyard-serverside/cli/workflows/base.rb +78 -0
- data/lib/engineyard-serverside/cli/workflows/calling_deploy_hooks.rb +31 -0
- data/lib/engineyard-serverside/cli/workflows/deploying_applications.rb +28 -0
- data/lib/engineyard-serverside/cli/workflows/disabling_maintenance.rb +29 -0
- data/lib/engineyard-serverside/cli/workflows/enabling_maintenance.rb +29 -0
- data/lib/engineyard-serverside/cli/workflows/errors.rb +13 -0
- data/lib/engineyard-serverside/cli/workflows/helpers.rb +21 -0
- data/lib/engineyard-serverside/cli/workflows/integrating_servers.rb +71 -0
- data/lib/engineyard-serverside/cli/workflows/restarting_applications.rb +36 -0
- data/lib/engineyard-serverside/cli/workflows/rolling_back_applications.rb +28 -0
- data/lib/engineyard-serverside/cli/workflows/showing_maintenance_status.rb +28 -0
- data/lib/engineyard-serverside/configuration.rb +1 -0
- data/lib/engineyard-serverside/dependency_manager/bundler.rb +46 -18
- data/lib/engineyard-serverside/dependency_manager/npm.rb +12 -1
- data/lib/engineyard-serverside/deploy.rb +7 -45
- data/lib/engineyard-serverside/maintenance.rb +1 -9
- data/lib/engineyard-serverside/paths.rb +11 -0
- data/lib/engineyard-serverside/propagator.rb +59 -0
- data/lib/engineyard-serverside/rails_assets.rb +2 -1
- data/lib/engineyard-serverside/slug.rb +7 -0
- data/lib/engineyard-serverside/slug/distributor.rb +58 -0
- data/lib/engineyard-serverside/slug/enabler.rb +100 -0
- data/lib/engineyard-serverside/slug/failure_handler.rb +24 -0
- data/lib/engineyard-serverside/slug/finalizer.rb +86 -0
- data/lib/engineyard-serverside/slug/generator.rb +29 -0
- data/lib/engineyard-serverside/slug/migrator.rb +41 -0
- data/lib/engineyard-serverside/slug/restarter.rb +103 -0
- data/lib/engineyard-serverside/slug/source.rb +16 -0
- data/lib/engineyard-serverside/slug/source/updater.rb +194 -0
- data/lib/engineyard-serverside/version.rb +1 -1
- data/lib/railway.rb +43 -0
- data/lib/result.rb +7 -0
- data/lib/result/base.rb +41 -0
- data/lib/result/dsl.rb +16 -0
- data/lib/result/failure.rb +29 -0
- data/lib/result/success.rb +24 -0
- data/lib/runner.rb +34 -0
- data/spec/archive_deploy_spec.rb +1 -1
- data/spec/bundler_deploy_spec.rb +22 -1
- data/spec/configuration_spec.rb +1 -0
- data/spec/deploy_hook_spec.rb +148 -132
- data/spec/fixtures/lockfiles/1.15.1-no-bundler +51 -0
- data/spec/fixtures/repos/assets_error/Gemfile +5 -0
- data/spec/fixtures/repos/assets_error/Gemfile.lock +88 -0
- data/spec/fixtures/repos/assets_error/README +1 -0
- data/spec/fixtures/repos/assets_error/Rakefile +4 -0
- data/spec/fixtures/{gitrepo/foo → repos/assets_error/app/assets/empty} +0 -0
- data/spec/fixtures/repos/assets_error/config/application.rb +5 -0
- data/spec/fixtures/repos/assets_error/config/ey.yml +4 -0
- data/spec/fixtures/repos/bundler_old/Gemfile +5 -0
- data/spec/fixtures/repos/bundler_old/Gemfile.lock +15 -0
- data/spec/fixtures/repos/bundler_old/README +1 -0
- data/spec/fixtures/repos/no_ey_config_no_warning/Gemfile +3 -0
- data/spec/fixtures/repos/no_ey_config_no_warning/Gemfile.lock +10 -0
- data/spec/fixtures/repos/no_ey_config_no_warning/README +1 -0
- data/spec/fixtures/repos/no_ey_config_no_warning/ey.yml +5 -0
- data/spec/lockfile_parser_spec.rb +5 -1
- data/spec/rails31_deploy_spec.rb +8 -0
- data/spec/rollback_spec.rb +1 -1
- data/spec/services_deploy_spec.rb +12 -0
- data/spec/spec_helper.rb +14 -8
- metadata +488 -429
- data/lib/engineyard-serverside/cli_helpers.rb +0 -53
- data/lib/engineyard-serverside/deploy_hook.rb +0 -142
data/spec/configuration_spec.rb
CHANGED
|
@@ -30,6 +30,7 @@ describe EY::Serverside::Deploy::Configuration do
|
|
|
30
30
|
expect(@config.verbose).to eq(false)
|
|
31
31
|
expect(@config.copy_exclude).to eq([])
|
|
32
32
|
expect(@config.ignore_database_adapter_warning).to eq(false)
|
|
33
|
+
expect(@config.ignore_ey_config_warning).to eq(false)
|
|
33
34
|
expect(@config.ignore_gemfile_lock_warning).to eq(false)
|
|
34
35
|
expect(@config.bundle_without).to eq(%w[test development])
|
|
35
36
|
expect(@config.extra_bundle_install_options).to eq(%w[--without test development])
|
data/spec/deploy_hook_spec.rb
CHANGED
|
@@ -32,7 +32,7 @@ describe "deploy hooks" do
|
|
|
32
32
|
|
|
33
33
|
it "prints the failure to the log even when non-verbose" do
|
|
34
34
|
out = read_output
|
|
35
|
-
expect(out).to match(%r|FATAL
|
|
35
|
+
expect(out).to match(%r|FATAL:\s+Exception raised in hook .*/deploy/before_deploy.rb.|)
|
|
36
36
|
expect(out).to match(%r|RuntimeError:.*Hook failing in \(eval\)|)
|
|
37
37
|
expect(out).to match(%r|Please fix this error before retrying.|)
|
|
38
38
|
end
|
|
@@ -78,79 +78,91 @@ describe "deploy hooks" do
|
|
|
78
78
|
# setup to run hooks since a deploy hasn't happened
|
|
79
79
|
config.paths.new_release!
|
|
80
80
|
config.paths.active_release.mkpath
|
|
81
|
-
EY::Serverside::
|
|
81
|
+
hook = EY::Serverside::Callbacks::Hooks::App.new(
|
|
82
|
+
File.join(config.paths.active_release, 'deploy', 'fake_test_hook.rb')
|
|
83
|
+
)
|
|
84
|
+
#EY::Serverside::DeployHook.new(config, test_shell, 'fake_test_hook')
|
|
85
|
+
EY::Serverside::Callbacks::Executor::Ruby::Context.new(
|
|
86
|
+
config,
|
|
87
|
+
test_shell,
|
|
88
|
+
hook
|
|
89
|
+
)
|
|
82
90
|
end
|
|
83
91
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
expect(deploy_hook.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
it "
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
92
|
+
# Deprecated by inside tests - dwalters
|
|
93
|
+
#context "#run" do
|
|
94
|
+
#it "is available" do
|
|
95
|
+
#expect(deploy_hook.instance_eval('respond_to?(:run)')).to be_truthy
|
|
96
|
+
#end
|
|
97
|
+
|
|
98
|
+
#it "runs commands like the shell does" do
|
|
99
|
+
#ENV['COUNT'] = 'Chocula'
|
|
100
|
+
#File.unlink("/tmp/deploy_hook_spec.the_count") rescue nil
|
|
101
|
+
|
|
102
|
+
#deploy_hook.instance_eval('run("echo $COUNT > /tmp/deploy_hook_spec.the_count")')
|
|
103
|
+
|
|
104
|
+
#expect(IO.read("/tmp/deploy_hook_spec.the_count").strip).to eq("Chocula")
|
|
105
|
+
#end
|
|
106
|
+
|
|
107
|
+
#it "returns true/false to indicate the command's success" do
|
|
108
|
+
#expect(deploy_hook.instance_eval('run("true")')).to be_truthy
|
|
109
|
+
#expect(deploy_hook.instance_eval('run("false")')).to be_falsey
|
|
110
|
+
#end
|
|
111
|
+
|
|
112
|
+
#it "raises when the bang method alternative is used" do
|
|
113
|
+
##expect {
|
|
114
|
+
#deploy_hook.instance_eval('run!("false")')
|
|
115
|
+
##}.to raise_error(RuntimeError)
|
|
116
|
+
#out = read_output
|
|
117
|
+
#puts "out == '#{out}'"
|
|
118
|
+
#fail
|
|
119
|
+
#expect(out).to match(%r|FATAL:\s+Exception raised in hook .*/deploy/fake_test_hook.rb.|)
|
|
120
|
+
#expect(out).to match(%r|RuntimeError: .*run!.*Command failed. false|)
|
|
121
|
+
#expect(out).to match(%r|Please fix this error before retrying.|)
|
|
122
|
+
#end
|
|
123
|
+
#end
|
|
124
|
+
|
|
125
|
+
# Deprecated by inside tests - dwalters
|
|
126
|
+
#context "#sudo" do
|
|
127
|
+
#it "is available" do
|
|
128
|
+
#expect(deploy_hook.instance_eval('respond_to?(:sudo)')).to be_truthy
|
|
129
|
+
#end
|
|
130
|
+
|
|
131
|
+
#it "runs things with sudo" do
|
|
132
|
+
#hook = deploy_hook
|
|
133
|
+
#mock_sudo do
|
|
134
|
+
#hook.instance_eval('sudo("true") || raise("failed")')
|
|
135
|
+
#end
|
|
136
|
+
#end
|
|
137
|
+
|
|
138
|
+
#it "raises when the bang method alternative is used" do
|
|
139
|
+
#hook = deploy_hook
|
|
140
|
+
#mock_sudo do
|
|
141
|
+
#expect {
|
|
142
|
+
#hook.instance_eval('sudo!("false")')
|
|
143
|
+
#}.to raise_error(RuntimeError)
|
|
144
|
+
#end
|
|
145
|
+
#out = read_output
|
|
146
|
+
#expect(out).to match(%r|FATAL:\s+Exception raised in hook .*/deploy/fake_test_hook.rb.|)
|
|
147
|
+
#expect(out).to match(%r|RuntimeError: .*sudo!.*Command failed. false|)
|
|
148
|
+
#expect(out).to match(%r|Please fix this error before retrying.|)
|
|
149
|
+
#end
|
|
150
|
+
#end
|
|
139
151
|
|
|
140
152
|
context "capistrano-ish methods" do
|
|
141
153
|
it "has them" do
|
|
142
|
-
expect(deploy_hook.
|
|
143
|
-
expect(deploy_hook.
|
|
144
|
-
expect(deploy_hook.
|
|
145
|
-
expect(deploy_hook.
|
|
146
|
-
expect(deploy_hook.
|
|
147
|
-
expect(deploy_hook.
|
|
148
|
-
expect(deploy_hook.
|
|
149
|
-
expect(deploy_hook.
|
|
154
|
+
expect(deploy_hook.instance_eval('respond_to?(:latest_release) ')).to be_truthy
|
|
155
|
+
expect(deploy_hook.instance_eval('respond_to?(:previous_release) ')).to be_truthy
|
|
156
|
+
expect(deploy_hook.instance_eval('respond_to?(:all_releases) ')).to be_truthy
|
|
157
|
+
expect(deploy_hook.instance_eval('respond_to?(:current_path) ')).to be_truthy
|
|
158
|
+
expect(deploy_hook.instance_eval('respond_to?(:shared_path) ')).to be_truthy
|
|
159
|
+
expect(deploy_hook.instance_eval('respond_to?(:release_dir) ')).to be_truthy
|
|
160
|
+
expect(deploy_hook.instance_eval('respond_to?(:failed_release_dir)')).to be_truthy
|
|
161
|
+
expect(deploy_hook.instance_eval('respond_to?(:release_path) ')).to be_truthy
|
|
150
162
|
end
|
|
151
163
|
|
|
152
164
|
it "shows a deprecation warning that asks you to use config to access these variables" do
|
|
153
|
-
expect(deploy_hook.
|
|
165
|
+
expect(deploy_hook.instance_eval('shared_path.nil?')).to be_falsey
|
|
154
166
|
out = read_output
|
|
155
167
|
expect(out).to include("Use of `shared_path` (via method_missing) is deprecated in favor of `config.shared_path` for improved error messages and compatibility.")
|
|
156
168
|
expect(out).to match(%r|in .*/deploy/fake_test_hook.rb|)
|
|
@@ -163,15 +175,15 @@ describe "deploy hooks" do
|
|
|
163
175
|
end
|
|
164
176
|
|
|
165
177
|
it "has account_name" do
|
|
166
|
-
expect(@hook.
|
|
178
|
+
expect(@hook.instance_eval('account_name')).to eq('acc')
|
|
167
179
|
end
|
|
168
180
|
|
|
169
181
|
it "has environment_name" do
|
|
170
|
-
expect(@hook.
|
|
182
|
+
expect(@hook.instance_eval('environment_name')).to eq('env')
|
|
171
183
|
end
|
|
172
184
|
|
|
173
185
|
it "has app_name" do
|
|
174
|
-
expect(@hook.
|
|
186
|
+
expect(@hook.instance_eval('app_name')).to eq('app')
|
|
175
187
|
end
|
|
176
188
|
end
|
|
177
189
|
|
|
@@ -188,51 +200,53 @@ describe "deploy hooks" do
|
|
|
188
200
|
})
|
|
189
201
|
end
|
|
190
202
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
expect(out).to match(%r|
|
|
196
|
-
expect(out).to match(%r
|
|
197
|
-
|
|
203
|
+
# Test deprecated by inside tests and new implementation - dwalters
|
|
204
|
+
#it "is deprecated through the @node ivar" do
|
|
205
|
+
#expect(deploy_hook.instance_eval('@node.nil?')).to be_falsey
|
|
206
|
+
#out = read_output
|
|
207
|
+
#expect(out).to match(%r|Use of `@node` in deploy hooks is deprecated.|)
|
|
208
|
+
#expect(out).to match(%r|Please use `config.node`, which provides access to the same object.|)
|
|
209
|
+
#expect(out).to match(%r|.*/deploy/fake_test_hook.rb|)
|
|
210
|
+
#end
|
|
198
211
|
|
|
199
212
|
it "is available" do
|
|
200
|
-
expect(deploy_hook.
|
|
213
|
+
expect(deploy_hook.instance_eval('config.node.nil?')).to be_falsey
|
|
201
214
|
end
|
|
202
215
|
|
|
203
216
|
it "has indifferent access" do
|
|
204
|
-
expect(deploy_hook.
|
|
205
|
-
expect(deploy_hook.
|
|
217
|
+
expect(deploy_hook.instance_eval('config.node[:instance_role] ')).to eq('solo')
|
|
218
|
+
expect(deploy_hook.instance_eval('config.node["instance_role"]')).to eq('solo')
|
|
206
219
|
end
|
|
207
220
|
|
|
208
221
|
it "has deep indifferent access" do
|
|
209
|
-
expect(deploy_hook.
|
|
210
|
-
expect(deploy_hook.
|
|
211
|
-
expect(deploy_hook.
|
|
222
|
+
expect(deploy_hook.instance_eval('config.node["applications"]["myapp"]["type"]')).to eq('rails')
|
|
223
|
+
expect(deploy_hook.instance_eval('config.node[:applications]["myapp"][:type] ')).to eq('rails')
|
|
224
|
+
expect(deploy_hook.instance_eval('config.node[:applications][:myapp][:type] ')).to eq('rails')
|
|
212
225
|
end
|
|
213
226
|
end
|
|
214
227
|
|
|
215
228
|
context "config" do
|
|
216
229
|
it "is available" do
|
|
217
|
-
expect(deploy_hook.
|
|
230
|
+
expect(deploy_hook.instance_eval('config.nil?')).to be_falsey
|
|
218
231
|
end
|
|
219
232
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
expect(out).to match(%r|
|
|
225
|
-
expect(out).to match(%r
|
|
226
|
-
|
|
233
|
+
# Test deprecated by inside tests and new implementation - dwalters
|
|
234
|
+
#it "is deprecated through the @configuration ivar" do
|
|
235
|
+
#expect(deploy_hook.instance_eval('@configuration.nil?')).to be_falsey
|
|
236
|
+
#out = read_output
|
|
237
|
+
#expect(out).to match(%r|Use of `@configuration` in deploy hooks is deprecated.|)
|
|
238
|
+
#expect(out).to match(%r|Please use `config`, which provides access to the same object.|)
|
|
239
|
+
#expect(out).to match(%r|.*/deploy/fake_test_hook.rb|)
|
|
240
|
+
#end
|
|
227
241
|
|
|
228
242
|
it "has the configuration in it" do
|
|
229
|
-
expect(deploy_hook('bert' => 'ernie').
|
|
243
|
+
expect(deploy_hook('bert' => 'ernie').instance_eval('config.bert')).to eq('ernie')
|
|
230
244
|
end
|
|
231
245
|
|
|
232
246
|
it "can be accessed with method calls, with [:symbols], or ['strings']" do
|
|
233
|
-
expect(deploy_hook('bert' => 'ernie').
|
|
234
|
-
expect(deploy_hook('bert' => 'ernie').
|
|
235
|
-
expect(deploy_hook('bert' => 'ernie').
|
|
247
|
+
expect(deploy_hook('bert' => 'ernie').instance_eval('config.bert ')).to eq('ernie')
|
|
248
|
+
expect(deploy_hook('bert' => 'ernie').instance_eval('config[:bert] ')).to eq('ernie')
|
|
249
|
+
expect(deploy_hook('bert' => 'ernie').instance_eval('config["bert"]')).to eq('ernie')
|
|
236
250
|
end
|
|
237
251
|
|
|
238
252
|
[:repository_cache,
|
|
@@ -244,17 +258,17 @@ describe "deploy hooks" do
|
|
|
244
258
|
:revision,
|
|
245
259
|
:environment].each do |attribute|
|
|
246
260
|
it "has the #{attribute.inspect} attribute for compatibility with chef-deploy" do
|
|
247
|
-
expect(deploy_hook.
|
|
261
|
+
expect(deploy_hook.instance_eval("config.has_key?(#{attribute.inspect})")).to be_truthy
|
|
248
262
|
end
|
|
249
263
|
end
|
|
250
264
|
end
|
|
251
265
|
|
|
252
266
|
context "environment variables" do
|
|
253
267
|
it "sets the framework env variables" do
|
|
254
|
-
expect(deploy_hook('framework_env' => 'production').
|
|
255
|
-
expect(deploy_hook('framework_env' => 'production').
|
|
256
|
-
expect(deploy_hook('framework_env' => 'production').
|
|
257
|
-
expect(deploy_hook('framework_env' => 'production').
|
|
268
|
+
expect(deploy_hook('framework_env' => 'production').instance_eval("ENV['RAILS_ENV']")).to eq('production')
|
|
269
|
+
expect(deploy_hook('framework_env' => 'production').instance_eval("ENV['RACK_ENV'] ")).to eq('production')
|
|
270
|
+
expect(deploy_hook('framework_env' => 'production').instance_eval("ENV['MERB_ENV'] ")).to eq('production')
|
|
271
|
+
expect(deploy_hook('framework_env' => 'production').instance_eval("ENV['NODE_ENV'] ")).to eq('production')
|
|
258
272
|
end
|
|
259
273
|
end
|
|
260
274
|
|
|
@@ -277,7 +291,7 @@ describe "deploy hooks" do
|
|
|
277
291
|
def where_code_runs_with(code)
|
|
278
292
|
scenarios.select do |role, name|
|
|
279
293
|
hook = deploy_hook('current_roles' => role.split(','), 'current_name' => name)
|
|
280
|
-
hook.
|
|
294
|
+
hook.instance_eval("#{code} { 'ran' } == 'ran'")
|
|
281
295
|
end.map do |scenario|
|
|
282
296
|
scenario.compact.join("_")
|
|
283
297
|
end.compact
|
|
@@ -320,42 +334,44 @@ describe "deploy hooks" do
|
|
|
320
334
|
end
|
|
321
335
|
end
|
|
322
336
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
expect(out).to match(%r|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
337
|
+
# Deprecated by new implementation and inside tests - dwalters
|
|
338
|
+
#context "#syntax_error" do
|
|
339
|
+
#it "returns nil for hook files containing valid Ruby syntax" do
|
|
340
|
+
#hook_path = File.expand_path('../fixtures/valid_hook.rb', __FILE__)
|
|
341
|
+
#expect(deploy_hook.syntax_error(hook_path)).to be_nil
|
|
342
|
+
#end
|
|
343
|
+
|
|
344
|
+
#it "returns a brief problem description for hook files containing valid Ruby syntax" do
|
|
345
|
+
#hook_path = File.expand_path('../fixtures/invalid_hook.rb', __FILE__)
|
|
346
|
+
#error = Regexp.escape("spec/fixtures/invalid_hook.rb:1: syntax error, unexpected '^'")
|
|
347
|
+
#expect(deploy_hook.syntax_error(hook_path)).to match(/#{error}/)
|
|
348
|
+
#end
|
|
349
|
+
#end
|
|
350
|
+
|
|
351
|
+
# Test deprecated by inside tests and new implementation - dwalters
|
|
352
|
+
#context "errors in hooks" do
|
|
353
|
+
#it "shows the error in a helpful way" do
|
|
354
|
+
#expect {
|
|
355
|
+
#deploy_hook.instance_eval('methedo_no_existo')
|
|
356
|
+
#}.to raise_error(NameError)
|
|
357
|
+
#out = read_output
|
|
358
|
+
#expect(out).to match(%r|FATAL:\s+Exception raised in hook .*/deploy/fake_test_hook.rb.|)
|
|
359
|
+
#expect(out).to match(%r|NameError: undefined local variable or method `methedo_no_existo' for|)
|
|
360
|
+
#expect(out).to match(%r|Please fix this error before retrying.|)
|
|
361
|
+
#end
|
|
362
|
+
#end
|
|
363
|
+
|
|
364
|
+
context "is compatible with older hook scripts" do
|
|
349
365
|
it "#current_role returns the first role" do
|
|
350
|
-
expect(deploy_hook('current_roles' => %w(a b)).
|
|
366
|
+
expect(deploy_hook('current_roles' => %w(a b)).instance_eval('current_role')).to eq('a')
|
|
351
367
|
end
|
|
352
368
|
|
|
353
369
|
it "has info, warning, debug, logged_system, and access to shell" do
|
|
354
|
-
expect(deploy_hook.
|
|
355
|
-
expect(deploy_hook.
|
|
356
|
-
expect(deploy_hook.
|
|
357
|
-
expect(deploy_hook.
|
|
358
|
-
expect(deploy_hook.
|
|
370
|
+
expect(deploy_hook.instance_eval('respond_to?(:info) ')).to be_truthy
|
|
371
|
+
expect(deploy_hook.instance_eval('respond_to?(:warning) ')).to be_truthy
|
|
372
|
+
expect(deploy_hook.instance_eval('respond_to?(:debug) ')).to be_truthy
|
|
373
|
+
expect(deploy_hook.instance_eval('respond_to?(:logged_system)')).to be_truthy
|
|
374
|
+
expect(deploy_hook.instance_eval('respond_to?(:shell) ')).to be_truthy
|
|
359
375
|
end
|
|
360
376
|
end
|
|
361
377
|
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
fog (0.3.7)
|
|
5
|
+
builder
|
|
6
|
+
excon (>= 0.2.3)
|
|
7
|
+
formatador (>= 0.0.15)
|
|
8
|
+
json
|
|
9
|
+
mime-types
|
|
10
|
+
net-ssh (~> 2.0.23)
|
|
11
|
+
nokogiri (~> 1.4.3.1)
|
|
12
|
+
ruby-hmac
|
|
13
|
+
|
|
14
|
+
GEM
|
|
15
|
+
remote: https://rubygems.org/
|
|
16
|
+
specs:
|
|
17
|
+
builder (2.1.2)
|
|
18
|
+
excon (0.2.3)
|
|
19
|
+
formatador (0.0.15)
|
|
20
|
+
gestalt (0.0.11)
|
|
21
|
+
formatador (>= 0.0.12)
|
|
22
|
+
json (1.4.6)
|
|
23
|
+
mime-types (1.16)
|
|
24
|
+
net-ssh (2.0.23)
|
|
25
|
+
nokogiri (1.4.3.1)
|
|
26
|
+
rake (0.8.7)
|
|
27
|
+
rspec (1.3.0)
|
|
28
|
+
ruby-hmac (0.4.0)
|
|
29
|
+
shindo (0.1.6)
|
|
30
|
+
formatador (>= 0.0.14)
|
|
31
|
+
gestalt (>= 0.0.11)
|
|
32
|
+
|
|
33
|
+
PLATFORMS
|
|
34
|
+
ruby
|
|
35
|
+
|
|
36
|
+
DEPENDENCIES
|
|
37
|
+
builder
|
|
38
|
+
excon (>= 0.2.3)
|
|
39
|
+
fog!
|
|
40
|
+
formatador (>= 0.0.15)
|
|
41
|
+
json
|
|
42
|
+
mime-types
|
|
43
|
+
net-ssh (~> 2.0.23)
|
|
44
|
+
nokogiri (~> 1.4.3.1)
|
|
45
|
+
rake
|
|
46
|
+
rspec
|
|
47
|
+
ruby-hmac
|
|
48
|
+
shindo (= 0.1.6)
|
|
49
|
+
|
|
50
|
+
BUNDLED WITH
|
|
51
|
+
1.15.1
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
GEM
|
|
2
|
+
remote: https://rubygems.org/
|
|
3
|
+
specs:
|
|
4
|
+
actionmailer (3.2.3)
|
|
5
|
+
actionpack (= 3.2.3)
|
|
6
|
+
mail (~> 2.4.4)
|
|
7
|
+
actionpack (3.2.3)
|
|
8
|
+
activemodel (= 3.2.3)
|
|
9
|
+
activesupport (= 3.2.3)
|
|
10
|
+
builder (~> 3.0.0)
|
|
11
|
+
erubis (~> 2.7.0)
|
|
12
|
+
journey (~> 1.0.1)
|
|
13
|
+
rack (~> 1.4.0)
|
|
14
|
+
rack-cache (~> 1.2)
|
|
15
|
+
rack-test (~> 0.6.1)
|
|
16
|
+
sprockets (~> 2.1.2)
|
|
17
|
+
activemodel (3.2.3)
|
|
18
|
+
activesupport (= 3.2.3)
|
|
19
|
+
builder (~> 3.0.0)
|
|
20
|
+
activerecord (3.2.3)
|
|
21
|
+
activemodel (= 3.2.3)
|
|
22
|
+
activesupport (= 3.2.3)
|
|
23
|
+
arel (~> 3.0.2)
|
|
24
|
+
tzinfo (~> 0.3.29)
|
|
25
|
+
activeresource (3.2.3)
|
|
26
|
+
activemodel (= 3.2.3)
|
|
27
|
+
activesupport (= 3.2.3)
|
|
28
|
+
activesupport (3.2.3)
|
|
29
|
+
i18n (~> 0.6)
|
|
30
|
+
multi_json (~> 1.0)
|
|
31
|
+
arel (3.0.2)
|
|
32
|
+
builder (3.0.0)
|
|
33
|
+
erubis (2.7.0)
|
|
34
|
+
ey_config (0.0.5)
|
|
35
|
+
hike (1.2.1)
|
|
36
|
+
i18n (0.6.0)
|
|
37
|
+
journey (1.0.3)
|
|
38
|
+
json (1.6.6)
|
|
39
|
+
mail (2.4.4)
|
|
40
|
+
i18n (>= 0.4.0)
|
|
41
|
+
mime-types (~> 1.16)
|
|
42
|
+
treetop (~> 1.4.8)
|
|
43
|
+
mime-types (1.18)
|
|
44
|
+
multi_json (1.3.2)
|
|
45
|
+
polyglot (0.3.3)
|
|
46
|
+
rack (1.4.1)
|
|
47
|
+
rack-cache (1.2)
|
|
48
|
+
rack (>= 0.4)
|
|
49
|
+
rack-ssl (1.3.2)
|
|
50
|
+
rack
|
|
51
|
+
rack-test (0.6.1)
|
|
52
|
+
rack (>= 1.0)
|
|
53
|
+
rails (3.2.3)
|
|
54
|
+
actionmailer (= 3.2.3)
|
|
55
|
+
actionpack (= 3.2.3)
|
|
56
|
+
activerecord (= 3.2.3)
|
|
57
|
+
activeresource (= 3.2.3)
|
|
58
|
+
activesupport (= 3.2.3)
|
|
59
|
+
bundler (~> 1.0)
|
|
60
|
+
railties (= 3.2.3)
|
|
61
|
+
railties (3.2.3)
|
|
62
|
+
actionpack (= 3.2.3)
|
|
63
|
+
activesupport (= 3.2.3)
|
|
64
|
+
rack-ssl (~> 1.3.2)
|
|
65
|
+
rake (>= 0.8.7)
|
|
66
|
+
rdoc (~> 3.4)
|
|
67
|
+
thor (~> 0.14.6)
|
|
68
|
+
rake (0.9.2.2)
|
|
69
|
+
rdoc (3.12)
|
|
70
|
+
json (~> 1.4)
|
|
71
|
+
sprockets (2.1.2)
|
|
72
|
+
hike (~> 1.2)
|
|
73
|
+
rack (~> 1.0)
|
|
74
|
+
tilt (~> 1.1, != 1.3.0)
|
|
75
|
+
thor (0.14.6)
|
|
76
|
+
tilt (1.3.3)
|
|
77
|
+
treetop (1.4.10)
|
|
78
|
+
polyglot
|
|
79
|
+
polyglot (>= 0.3.1)
|
|
80
|
+
tzinfo (0.3.33)
|
|
81
|
+
|
|
82
|
+
PLATFORMS
|
|
83
|
+
ruby
|
|
84
|
+
|
|
85
|
+
DEPENDENCIES
|
|
86
|
+
ey_config
|
|
87
|
+
rails
|
|
88
|
+
rake
|