capistrano-sbt 0.1.1 → 0.1.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.
- data/lib/capistrano-sbt.rb +9 -5
- data/lib/capistrano-sbt/version.rb +1 -1
- data/test/config/deploy.rb +54 -0
- metadata +1 -1
data/lib/capistrano-sbt.rb
CHANGED
@@ -125,14 +125,18 @@ module Capistrano
|
|
125
125
|
_cset(:sbt_common_environment, {})
|
126
126
|
_cset(:sbt_default_environment) {
|
127
127
|
environment = {}
|
128
|
-
|
129
|
-
|
128
|
+
if sbt_setup_remotely
|
129
|
+
environment["JAVA_HOME"] = fetch(:sbt_java_home) if exists?(:sbt_java_home)
|
130
|
+
environment["PATH"] = [ sbt_bin_path, "$PATH" ].join(":")
|
131
|
+
end
|
130
132
|
_merge_environment(sbt_common_environment, environment)
|
131
133
|
}
|
132
134
|
_cset(:sbt_default_environment_local) {
|
133
135
|
environment = {}
|
134
|
-
|
135
|
-
|
136
|
+
if sbt_setup_locally
|
137
|
+
environment["JAVA_HOME"] = fetch(:sbt_java_home_local) if exists?(:sbt_java_home_local)
|
138
|
+
environment["PATH"] = [ sbt_bin_path, "$PATH" ].join(":")
|
139
|
+
end
|
136
140
|
_merge_environment(sbt_common_environment, environment)
|
137
141
|
}
|
138
142
|
_cset(:sbt_environment) { _merge_environment(sbt_default_environment, fetch(:sbt_extra_environment, {})) }
|
@@ -471,7 +475,7 @@ module Capistrano
|
|
471
475
|
system(cmdline)
|
472
476
|
end
|
473
477
|
if $?.to_i > 0 # $? is command exit code (posix style)
|
474
|
-
raise Capistrano::LocalArgumentError, "Command #{
|
478
|
+
raise Capistrano::LocalArgumentError, "Command #{cmdline} returned status code #{$?}"
|
475
479
|
end
|
476
480
|
logger.trace "command finished in #{(elapsed * 1000).round}ms"
|
477
481
|
end
|
data/test/config/deploy.rb
CHANGED
@@ -98,6 +98,28 @@ def uninstall_sbt!
|
|
98
98
|
reset_sbt!
|
99
99
|
end
|
100
100
|
|
101
|
+
def _test_sbt_exec_fails(args=[], options={})
|
102
|
+
failed = false
|
103
|
+
begin
|
104
|
+
sbt.exec(args, options)
|
105
|
+
rescue
|
106
|
+
failed = true
|
107
|
+
ensure
|
108
|
+
abort unless failed
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
def _test_sbt_exec_locally_fails(args=[], options={})
|
113
|
+
failed = false
|
114
|
+
begin
|
115
|
+
sbt.exec_locally(args, options)
|
116
|
+
rescue
|
117
|
+
failed = true
|
118
|
+
ensure
|
119
|
+
abort unless failed
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
101
123
|
task(:test_all) {
|
102
124
|
find_and_execute_task("test_default")
|
103
125
|
find_and_execute_task("test_with_remote")
|
@@ -163,10 +185,18 @@ namespace(:test_default) {
|
|
163
185
|
sbt.exec("--version")
|
164
186
|
}
|
165
187
|
|
188
|
+
task(:test_sbt_exec_fails) {
|
189
|
+
_test_sbt_exec_fails("MUST-FAIL")
|
190
|
+
}
|
191
|
+
|
166
192
|
task(:test_sbt_exec_locally) {
|
167
193
|
sbt.exec_locally("--version")
|
168
194
|
}
|
169
195
|
|
196
|
+
task(:test_sbt_exec_locally_fails) {
|
197
|
+
_test_sbt_exec_locally_fails("MUST-FAIL")
|
198
|
+
}
|
199
|
+
|
170
200
|
task(:test_sbt_artifact) {
|
171
201
|
assert_file_exists(File.join(sbt_target_path, "scala-2.10", "capistrano-sbt_2.10-0.0.1-SNAPSHOT.jar"))
|
172
202
|
}
|
@@ -229,8 +259,16 @@ namespace(:test_with_remote) {
|
|
229
259
|
sbt.exec("--version")
|
230
260
|
}
|
231
261
|
|
262
|
+
task(:test_sbt_exec_fails) {
|
263
|
+
_test_sbt_exec_fails("MUST-FAIL")
|
264
|
+
}
|
265
|
+
|
232
266
|
# task(:test_sbt_exec_locally) {
|
233
267
|
# sbt.exec_locally("--version")
|
268
|
+
# }
|
269
|
+
|
270
|
+
# task(:test_sbt_exec_locally_fails) {
|
271
|
+
# _test_sbt_exec_locally_fails("MUST-FAIL")
|
234
272
|
# }
|
235
273
|
|
236
274
|
task(:test_sbt_artifact) {
|
@@ -293,12 +331,20 @@ namespace(:test_with_local) {
|
|
293
331
|
|
294
332
|
# task(:test_sbt_exec) {
|
295
333
|
# sbt.exec("--version")
|
334
|
+
# }
|
335
|
+
|
336
|
+
# task(:test_sbt_exec_fails) {
|
337
|
+
# _test_sbt_exec_fails("MUST-FAIL")
|
296
338
|
# }
|
297
339
|
|
298
340
|
task(:test_sbt_exec_locally) {
|
299
341
|
sbt.exec_locally("--version")
|
300
342
|
}
|
301
343
|
|
344
|
+
task(:test_sbt_exec_locally_fails) {
|
345
|
+
_test_sbt_exec_locally_fails("MUST-FAIL")
|
346
|
+
}
|
347
|
+
|
302
348
|
task(:test_sbt_artifact) {
|
303
349
|
assert_file_exists(File.join(sbt_target_path, "scala-2.10", "capistrano-sbt_2.10-0.0.1-SNAPSHOT.jar"))
|
304
350
|
}
|
@@ -413,10 +459,18 @@ namespace(:test_with_launch_jar) {
|
|
413
459
|
sbt.exec("--version")
|
414
460
|
}
|
415
461
|
|
462
|
+
task(:test_sbt_exec_fails) {
|
463
|
+
_test_sbt_exec_fails("MUST-FAIL")
|
464
|
+
}
|
465
|
+
|
416
466
|
task(:test_sbt_exec_locally) {
|
417
467
|
sbt.exec_locally("--version")
|
418
468
|
}
|
419
469
|
|
470
|
+
task(:test_sbt_exec_locally_fails) {
|
471
|
+
_test_sbt_exec_locally_fails("MUST-FAIL")
|
472
|
+
}
|
473
|
+
|
420
474
|
task(:test_sbt_artifact) {
|
421
475
|
assert_file_exists(File.join(sbt_target_path, "scala-2.10", "capistrano-sbt_2.10-0.0.1-SNAPSHOT.jar"))
|
422
476
|
}
|