capistrano 2.5.2 → 2.5.3
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/CHANGELOG.rdoc +13 -0
- data/capistrano.gemspec +2 -2
- data/lib/capistrano/cli/help.rb +8 -1
- data/lib/capistrano/recipes/deploy.rb +12 -5
- data/lib/capistrano/recipes/deploy/scm/git.rb +7 -7
- data/lib/capistrano/transfer.rb +2 -2
- data/lib/capistrano/version.rb +1 -1
- data/test/deploy/scm/git_test.rb +8 -0
- metadata +2 -2
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
== 2.5.3 / December 6, 2008
|
2
|
+
|
3
|
+
* Make previous_release return nil if there is no previous release [Mathias Meyer]
|
4
|
+
|
5
|
+
* Play nice with rubies that don't inspect terminals well (ie. JRuby) by defaulting screen columns to 80 [Bob McWhirter]
|
6
|
+
|
7
|
+
* Rollback of deploy:symlink would explode if there was no previous revision to rollback to [Jamis Buck]
|
8
|
+
|
9
|
+
* Fix bug in transfer.rb that caused get/put/upload/download to ignore blocks passed to them [arika]
|
10
|
+
|
11
|
+
* Fix issue with git SCM that caused "Unable to resolve revision" errors when there was trailing whitespace in git's output [Mark Zuneska, Daniel Berlinger and Evan Closson]
|
12
|
+
|
13
|
+
|
1
14
|
== 2.5.2 / November 13, 2008
|
2
15
|
|
3
16
|
* Fix issue with git SCM that caused "Unable to resolve revision for 'HEAD'" errors on deploy [Jamis Buck]
|
data/capistrano.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = %q{capistrano}
|
3
|
-
s.version = "2.5.
|
3
|
+
s.version = "2.5.3"
|
4
4
|
|
5
5
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
6
6
|
s.authors = ["Jamis Buck"]
|
7
|
-
s.date = %q{2008-
|
7
|
+
s.date = %q{2008-12-06}
|
8
8
|
s.description = %q{Capistrano is a utility and framework for executing commands in parallel on multiple remote machines, via SSH.}
|
9
9
|
s.email = %q{jamis@jamisbuck.org}
|
10
10
|
s.executables = ["cap", "capify"]
|
data/lib/capistrano/cli/help.rb
CHANGED
@@ -111,7 +111,14 @@ module Capistrano
|
|
111
111
|
end
|
112
112
|
|
113
113
|
def output_columns #:nodoc:
|
114
|
-
@output_columns
|
114
|
+
if ( @output_columns.nil? )
|
115
|
+
if ( self.class.ui.output_cols.nil? || self.class.ui.output_cols > 80 )
|
116
|
+
@output_columns = 80
|
117
|
+
else
|
118
|
+
@output_columns = self.class.ui.output_cols
|
119
|
+
end
|
120
|
+
end
|
121
|
+
@output_columns
|
115
122
|
end
|
116
123
|
end
|
117
124
|
end
|
@@ -52,7 +52,7 @@ _cset(:release_path) { File.join(releases_path, release_name) }
|
|
52
52
|
|
53
53
|
_cset(:releases) { capture("ls -xt #{releases_path}").split.reverse }
|
54
54
|
_cset(:current_release) { File.join(releases_path, releases.last) }
|
55
|
-
_cset(:previous_release) { File.join(releases_path, releases[-2]) }
|
55
|
+
_cset(:previous_release) { releases.length > 1 ? File.join(releases_path, releases[-2]) : nil }
|
56
56
|
|
57
57
|
_cset(:current_revision) { capture("cat #{current_path}/REVISION").chomp }
|
58
58
|
_cset(:latest_revision) { capture("cat #{current_release}/REVISION").chomp }
|
@@ -251,7 +251,14 @@ namespace :deploy do
|
|
251
251
|
except `restart').
|
252
252
|
DESC
|
253
253
|
task :symlink, :except => { :no_release => true } do
|
254
|
-
on_rollback
|
254
|
+
on_rollback do
|
255
|
+
if previous_release
|
256
|
+
run "rm -f #{current_path}; ln -s #{previous_release} #{current_path}; true"
|
257
|
+
else
|
258
|
+
logger.important "no previous release to rollback to, rollback of symlink skipped"
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
255
262
|
run "rm -f #{current_path} && ln -s #{latest_release} #{current_path}"
|
256
263
|
end
|
257
264
|
|
@@ -302,10 +309,10 @@ namespace :deploy do
|
|
302
309
|
ever) need to be called directly.
|
303
310
|
DESC
|
304
311
|
task :revision, :except => { :no_release => true } do
|
305
|
-
if
|
306
|
-
abort "could not rollback the code because there is no prior release"
|
307
|
-
else
|
312
|
+
if previous_release
|
308
313
|
run "rm #{current_path}; ln -s #{previous_release} #{current_path}"
|
314
|
+
else
|
315
|
+
abort "could not rollback the code because there is no prior release"
|
309
316
|
end
|
310
317
|
end
|
311
318
|
|
@@ -213,14 +213,14 @@ module Capistrano
|
|
213
213
|
command = scm('ls-remote', repository, revision)
|
214
214
|
result = yield(command)
|
215
215
|
revdata = result.split(/[\t\n]/)
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
216
|
+
newrev = nil
|
217
|
+
revdata.each_slice(2) do |refs|
|
218
|
+
rev, ref = *refs
|
219
|
+
if ref.sub(/refs\/.*?\//, '').strip == revision
|
220
|
+
newrev = rev
|
221
|
+
break
|
222
222
|
end
|
223
|
-
|
223
|
+
end
|
224
224
|
raise "Unable to resolve revision for '#{revision}' on repository '#{repository}'." unless newrev =~ /^[0-9a-f]{40}$/
|
225
225
|
return newrev
|
226
226
|
end
|
data/lib/capistrano/transfer.rb
CHANGED
@@ -29,7 +29,7 @@ module Capistrano
|
|
29
29
|
@to = to
|
30
30
|
@sessions = sessions
|
31
31
|
@options = options
|
32
|
-
@callback =
|
32
|
+
@callback = block
|
33
33
|
|
34
34
|
@transport = options.fetch(:via, :sftp)
|
35
35
|
@logger = options.delete(:logger)
|
@@ -213,4 +213,4 @@ module Capistrano
|
|
213
213
|
end
|
214
214
|
end
|
215
215
|
end
|
216
|
-
end
|
216
|
+
end
|
data/lib/capistrano/version.rb
CHANGED
data/test/deploy/scm/git_test.rb
CHANGED
@@ -64,6 +64,14 @@ class DeploySCMGitTest < Test::Unit::TestCase
|
|
64
64
|
end
|
65
65
|
assert_equal "d11006102c07c94e5d54dd0ee63dca825c93ed61", revision
|
66
66
|
end
|
67
|
+
|
68
|
+
def test_query_revision_has_whitespace
|
69
|
+
revision = @source.query_revision('HEAD') do |o|
|
70
|
+
assert_equal "git ls-remote . HEAD", o
|
71
|
+
"d11006102c07c94e5d54dd0ee63dca825c93ed61\tHEAD\r"
|
72
|
+
end
|
73
|
+
assert_equal "d11006102c07c94e5d54dd0ee63dca825c93ed61", revision
|
74
|
+
end
|
67
75
|
|
68
76
|
def test_query_revision_deprecation_error
|
69
77
|
assert_raise(ArgumentError) do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamis Buck
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-12-06 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|