capistrano 1.4.2 → 2.0.0
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 +140 -4
- data/MIT-LICENSE +1 -1
- data/README +22 -14
- data/bin/cap +1 -8
- data/bin/capify +77 -0
- data/examples/sample.rb +10 -109
- data/lib/capistrano.rb +1 -0
- data/lib/capistrano/callback.rb +41 -0
- data/lib/capistrano/cli.rb +17 -317
- data/lib/capistrano/cli/execute.rb +82 -0
- data/lib/capistrano/cli/help.rb +102 -0
- data/lib/capistrano/cli/help.txt +53 -0
- data/lib/capistrano/cli/options.rb +183 -0
- data/lib/capistrano/cli/ui.rb +28 -0
- data/lib/capistrano/command.rb +62 -29
- data/lib/capistrano/configuration.rb +25 -226
- data/lib/capistrano/configuration/actions/file_transfer.rb +35 -0
- data/lib/capistrano/configuration/actions/inspect.rb +46 -0
- data/lib/capistrano/configuration/actions/invocation.rb +127 -0
- data/lib/capistrano/configuration/callbacks.rb +148 -0
- data/lib/capistrano/configuration/connections.rb +159 -0
- data/lib/capistrano/configuration/execution.rb +126 -0
- data/lib/capistrano/configuration/loading.rb +112 -0
- data/lib/capistrano/configuration/namespaces.rb +190 -0
- data/lib/capistrano/configuration/roles.rb +51 -0
- data/lib/capistrano/configuration/servers.rb +75 -0
- data/lib/capistrano/configuration/variables.rb +127 -0
- data/lib/capistrano/errors.rb +15 -0
- data/lib/capistrano/extensions.rb +27 -8
- data/lib/capistrano/gateway.rb +54 -29
- data/lib/capistrano/logger.rb +11 -11
- data/lib/capistrano/recipes/compat.rb +32 -0
- data/lib/capistrano/recipes/deploy.rb +483 -0
- data/lib/capistrano/recipes/deploy/dependencies.rb +44 -0
- data/lib/capistrano/recipes/deploy/local_dependency.rb +46 -0
- data/lib/capistrano/recipes/deploy/remote_dependency.rb +65 -0
- data/lib/capistrano/recipes/deploy/scm.rb +19 -0
- data/lib/capistrano/recipes/deploy/scm/base.rb +180 -0
- data/lib/capistrano/recipes/deploy/scm/bzr.rb +86 -0
- data/lib/capistrano/recipes/deploy/scm/cvs.rb +151 -0
- data/lib/capistrano/recipes/deploy/scm/darcs.rb +85 -0
- data/lib/capistrano/recipes/deploy/scm/mercurial.rb +129 -0
- data/lib/capistrano/recipes/deploy/scm/perforce.rb +126 -0
- data/lib/capistrano/recipes/deploy/scm/subversion.rb +103 -0
- data/lib/capistrano/recipes/deploy/strategy.rb +19 -0
- data/lib/capistrano/recipes/deploy/strategy/base.rb +64 -0
- data/lib/capistrano/recipes/deploy/strategy/checkout.rb +20 -0
- data/lib/capistrano/recipes/deploy/strategy/copy.rb +143 -0
- data/lib/capistrano/recipes/deploy/strategy/export.rb +20 -0
- data/lib/capistrano/recipes/deploy/strategy/remote.rb +52 -0
- data/lib/capistrano/recipes/deploy/strategy/remote_cache.rb +47 -0
- data/lib/capistrano/recipes/deploy/templates/maintenance.rhtml +53 -0
- data/lib/capistrano/recipes/standard.rb +26 -276
- data/lib/capistrano/recipes/templates/maintenance.rhtml +1 -1
- data/lib/capistrano/recipes/upgrade.rb +33 -0
- data/lib/capistrano/server_definition.rb +51 -0
- data/lib/capistrano/shell.rb +125 -81
- data/lib/capistrano/ssh.rb +80 -36
- data/lib/capistrano/task_definition.rb +69 -0
- data/lib/capistrano/upload.rb +146 -0
- data/lib/capistrano/version.rb +13 -17
- data/test/cli/execute_test.rb +132 -0
- data/test/cli/help_test.rb +139 -0
- data/test/cli/options_test.rb +226 -0
- data/test/cli/ui_test.rb +28 -0
- data/test/cli_test.rb +17 -0
- data/test/command_test.rb +284 -25
- data/test/configuration/actions/file_transfer_test.rb +40 -0
- data/test/configuration/actions/inspect_test.rb +62 -0
- data/test/configuration/actions/invocation_test.rb +195 -0
- data/test/configuration/callbacks_test.rb +206 -0
- data/test/configuration/connections_test.rb +288 -0
- data/test/configuration/execution_test.rb +159 -0
- data/test/configuration/loading_test.rb +119 -0
- data/test/configuration/namespace_dsl_test.rb +283 -0
- data/test/configuration/roles_test.rb +47 -0
- data/test/configuration/servers_test.rb +90 -0
- data/test/configuration/variables_test.rb +180 -0
- data/test/configuration_test.rb +60 -212
- data/test/deploy/scm/base_test.rb +55 -0
- data/test/deploy/strategy/copy_test.rb +146 -0
- data/test/extensions_test.rb +69 -0
- data/test/fixtures/cli_integration.rb +5 -0
- data/test/fixtures/custom.rb +2 -2
- data/test/gateway_test.rb +167 -0
- data/test/logger_test.rb +123 -0
- data/test/server_definition_test.rb +108 -0
- data/test/shell_test.rb +64 -0
- data/test/ssh_test.rb +67 -154
- data/test/task_definition_test.rb +101 -0
- data/test/upload_test.rb +131 -0
- data/test/utils.rb +31 -39
- data/test/version_test.rb +24 -0
- metadata +145 -98
- data/THANKS +0 -4
- data/lib/capistrano/actor.rb +0 -567
- data/lib/capistrano/generators/rails/deployment/deployment_generator.rb +0 -25
- data/lib/capistrano/generators/rails/deployment/templates/capistrano.rake +0 -49
- data/lib/capistrano/generators/rails/deployment/templates/deploy.rb +0 -122
- data/lib/capistrano/generators/rails/loader.rb +0 -20
- data/lib/capistrano/scm/base.rb +0 -61
- data/lib/capistrano/scm/baz.rb +0 -118
- data/lib/capistrano/scm/bzr.rb +0 -70
- data/lib/capistrano/scm/cvs.rb +0 -129
- data/lib/capistrano/scm/darcs.rb +0 -27
- data/lib/capistrano/scm/mercurial.rb +0 -83
- data/lib/capistrano/scm/perforce.rb +0 -139
- data/lib/capistrano/scm/subversion.rb +0 -128
- data/lib/capistrano/transfer.rb +0 -97
- data/lib/capistrano/utils.rb +0 -26
- data/test/actor_test.rb +0 -402
- data/test/scm/cvs_test.rb +0 -196
- data/test/scm/subversion_test.rb +0 -145
data/test/scm/cvs_test.rb
DELETED
@@ -1,196 +0,0 @@
|
|
1
|
-
$:.unshift File.dirname(__FILE__) + "/../../lib"
|
2
|
-
|
3
|
-
require File.dirname(__FILE__) + "/../utils"
|
4
|
-
require 'test/unit'
|
5
|
-
require 'capistrano/scm/cvs'
|
6
|
-
|
7
|
-
class ScmCvsTest < Test::Unit::TestCase
|
8
|
-
class CvsTest < Capistrano::SCM::Cvs
|
9
|
-
attr_accessor :story
|
10
|
-
attr_reader :last_path
|
11
|
-
|
12
|
-
def cvs_log(path,branch)
|
13
|
-
@last_path = path
|
14
|
-
story.shift
|
15
|
-
end
|
16
|
-
|
17
|
-
def cvs_branch(path)
|
18
|
-
"deploy-me"
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
class MockChannel
|
24
|
-
attr_reader :sent_data
|
25
|
-
|
26
|
-
def send_data(data)
|
27
|
-
@sent_data ||= []
|
28
|
-
@sent_data << data
|
29
|
-
end
|
30
|
-
|
31
|
-
def [](name)
|
32
|
-
"value"
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
class MockActor
|
37
|
-
attr_reader :command
|
38
|
-
attr_reader :channels
|
39
|
-
attr_accessor :story
|
40
|
-
|
41
|
-
def initialize(config)
|
42
|
-
@config = config
|
43
|
-
end
|
44
|
-
|
45
|
-
def run(command)
|
46
|
-
@command = command
|
47
|
-
@channels ||= []
|
48
|
-
@channels << MockChannel.new
|
49
|
-
story.each { |stream, line| yield @channels.last, stream, line }
|
50
|
-
end
|
51
|
-
|
52
|
-
def release_path
|
53
|
-
(@config[:now] || Time.now.utc).strftime("%Y%m%d%H%M%S")
|
54
|
-
end
|
55
|
-
|
56
|
-
def method_missing(sym, *args)
|
57
|
-
@config.send(sym, *args)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
def setup
|
62
|
-
@config = MockConfiguration.new
|
63
|
-
@config[:repository] = ":ext:joetester@rubyforge.org:/hello/world"
|
64
|
-
@config[:cvs] = "/path/to/cvs"
|
65
|
-
@config[:password] = "chocolatebrownies"
|
66
|
-
@config[:now] = Time.utc(2005,8,24,12,0,0)
|
67
|
-
@scm = CvsTest.new(@config)
|
68
|
-
@actor = MockActor.new(@config)
|
69
|
-
@log_msg = <<MSG.strip
|
70
|
-
RCS file: /var/cvs/copland/copland/LICENSE,v
|
71
|
-
Working file: LICENSE
|
72
|
-
head: 1.1
|
73
|
-
branch:
|
74
|
-
locks: strict
|
75
|
-
access list:
|
76
|
-
keyword substitution: kv
|
77
|
-
total revisions: 1; selected revisions: 1
|
78
|
-
description:
|
79
|
-
----------------------------
|
80
|
-
revision 1.1
|
81
|
-
date: 2004/08/29 04:23:36; author: minam; state: Exp;
|
82
|
-
New implementation.
|
83
|
-
=============================================================================
|
84
|
-
|
85
|
-
RCS file: /var/cvs/copland/copland/Rakefile,v
|
86
|
-
Working file: Rakefile
|
87
|
-
head: 1.7
|
88
|
-
branch:
|
89
|
-
locks: strict
|
90
|
-
access list:
|
91
|
-
keyword substitution: kv
|
92
|
-
total revisions: 7; selected revisions: 1
|
93
|
-
description:
|
94
|
-
----------------------------
|
95
|
-
revision 1.7
|
96
|
-
date: 2004/09/15 16:35:01; author: minam; state: Exp; lines: +2 -1
|
97
|
-
Rakefile now publishes package documentation from doc/packages instead of
|
98
|
-
doc/packrat. Updated "latest updates" in manual.
|
99
|
-
=============================================================================
|
100
|
-
|
101
|
-
RCS file: /var/cvs/copland/copland/TODO,v
|
102
|
-
Working file: TODO
|
103
|
-
head: 1.18
|
104
|
-
branch:
|
105
|
-
locks: strict
|
106
|
-
access list:
|
107
|
-
keyword substitution: kv
|
108
|
-
total revisions: 18; selected revisions: 1
|
109
|
-
description:
|
110
|
-
----------------------------
|
111
|
-
revision 1.18
|
112
|
-
date: 2004/10/12 02:21:02; author: minam; state: Exp; lines: +4 -1
|
113
|
-
Added RubyConf 2004 presentation.
|
114
|
-
=============================================================================
|
115
|
-
|
116
|
-
RCS file: /var/cvs/copland/copland/Attic/build-gemspec.rb,v
|
117
|
-
Working file: build-gemspec.rb
|
118
|
-
head: 1.5
|
119
|
-
branch:
|
120
|
-
locks: strict
|
121
|
-
access list:
|
122
|
-
keyword substitution: kv
|
123
|
-
total revisions: 5; selected revisions: 1
|
124
|
-
description:
|
125
|
-
----------------------------
|
126
|
-
revision 1.5
|
127
|
-
date: 2004/08/29 04:10:17; author: minam; state: dead; lines: +0 -0
|
128
|
-
Here we go -- point of no return. Deleting existing implementation to make
|
129
|
-
way for new implementation.
|
130
|
-
=============================================================================
|
131
|
-
|
132
|
-
RCS file: /var/cvs/copland/copland/copland.gemspec,v
|
133
|
-
Working file: copland.gemspec
|
134
|
-
head: 1.12
|
135
|
-
branch:
|
136
|
-
locks: strict
|
137
|
-
access list:
|
138
|
-
keyword substitution: kv
|
139
|
-
total revisions: 13; selected revisions: 1
|
140
|
-
description:
|
141
|
-
----------------------------
|
142
|
-
revision 1.12
|
143
|
-
date: 2004/09/11 21:45:58; author: minam; state: Exp; lines: +4 -4
|
144
|
-
Minor change in how version is communicated to gemspec.
|
145
|
-
=============================================================================
|
146
|
-
MSG
|
147
|
-
@scm.story = [ @log_msg ]
|
148
|
-
end
|
149
|
-
|
150
|
-
def test_latest_revision
|
151
|
-
@config[:local] = "/hello/world"
|
152
|
-
@scm.story = [ @log_msg ]
|
153
|
-
assert_equal "2004-10-12 02:21:02", @scm.latest_revision
|
154
|
-
assert_equal "/hello/world", @scm.last_path
|
155
|
-
end
|
156
|
-
|
157
|
-
def test_latest_with_default_local
|
158
|
-
@config[:local] = nil
|
159
|
-
@scm.story = [ @log_msg ]
|
160
|
-
assert_equal "2004-10-12 02:21:02", @scm.latest_revision
|
161
|
-
assert_equal ".", @scm.last_path
|
162
|
-
end
|
163
|
-
|
164
|
-
def test_checkout
|
165
|
-
@actor.story = []
|
166
|
-
assert_nothing_raised { @scm.checkout(@actor) }
|
167
|
-
assert_nil @actor.channels.last.sent_data
|
168
|
-
assert_match %r{/path/to/cvs}, @actor.command
|
169
|
-
end
|
170
|
-
|
171
|
-
def test_checkout_needs_ssh_password
|
172
|
-
@actor.story = [[:out, "joetester@rubyforge.org's password: "]]
|
173
|
-
assert_nothing_raised { @scm.checkout(@actor) }
|
174
|
-
assert_equal ["chocolatebrownies\n"], @actor.channels.last.sent_data
|
175
|
-
end
|
176
|
-
|
177
|
-
def test_current_branch
|
178
|
-
assert_equal "deploy-me", @scm.current_branch
|
179
|
-
end
|
180
|
-
|
181
|
-
def test_default_current_branch
|
182
|
-
@config[:branch] = "default-branch"
|
183
|
-
@scm = CvsTest.new(@config)
|
184
|
-
assert_equal "default-branch", @scm.current_branch
|
185
|
-
end
|
186
|
-
|
187
|
-
def test_default_local
|
188
|
-
@config = MockConfiguration.new
|
189
|
-
@config[:repository] = ":ext:joetester@rubyforge.org:/hello/world"
|
190
|
-
@config[:cvs] = "/path/to/cvs"
|
191
|
-
@config[:password] = "chocolatebrownies"
|
192
|
-
@config[:now] = Time.utc(2005,8,24,12,0,0)
|
193
|
-
@scm = CvsTest.new(@config)
|
194
|
-
assert_equal ".", @scm.configuration.local
|
195
|
-
end
|
196
|
-
end
|
data/test/scm/subversion_test.rb
DELETED
@@ -1,145 +0,0 @@
|
|
1
|
-
$:.unshift File.dirname(__FILE__) + "/../../lib"
|
2
|
-
|
3
|
-
require File.dirname(__FILE__) + "/../utils"
|
4
|
-
require 'test/unit'
|
5
|
-
require 'capistrano/scm/subversion'
|
6
|
-
|
7
|
-
class ScmSubversionTest < Test::Unit::TestCase
|
8
|
-
class SubversionTest < Capistrano::SCM::Subversion
|
9
|
-
attr_accessor :story
|
10
|
-
attr_reader :last_path
|
11
|
-
|
12
|
-
def svn_log(path)
|
13
|
-
@last_path = path
|
14
|
-
story.shift
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
class MockChannel
|
19
|
-
attr_reader :sent_data
|
20
|
-
|
21
|
-
def send_data(data)
|
22
|
-
@sent_data ||= []
|
23
|
-
@sent_data << data
|
24
|
-
end
|
25
|
-
|
26
|
-
def [](name)
|
27
|
-
"value"
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
class MockActor
|
32
|
-
attr_reader :command
|
33
|
-
attr_reader :channels
|
34
|
-
attr_accessor :story
|
35
|
-
|
36
|
-
def initialize(config)
|
37
|
-
@config = config
|
38
|
-
end
|
39
|
-
|
40
|
-
def run(command)
|
41
|
-
@command = command
|
42
|
-
@channels ||= []
|
43
|
-
@channels << MockChannel.new
|
44
|
-
story.each { |stream, line| yield @channels.last, stream, line }
|
45
|
-
end
|
46
|
-
|
47
|
-
def method_missing(sym, *args)
|
48
|
-
@config.send(sym, *args)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def setup
|
53
|
-
@config = MockConfiguration.new
|
54
|
-
@config[:current_path] = "/mwa/ha/ha/current"
|
55
|
-
@config[:repository] = "/hello/world"
|
56
|
-
@config[:svn] = "/path/to/svn"
|
57
|
-
@config[:password] = "chocolatebrownies"
|
58
|
-
@scm = SubversionTest.new(@config)
|
59
|
-
@actor = MockActor.new(@config)
|
60
|
-
@log_msg = <<MSG.strip
|
61
|
-
------------------------------------------------------------------------
|
62
|
-
r1967 | minam | 2005-08-03 06:59:03 -0600 (Wed, 03 Aug 2005) | 2 lines
|
63
|
-
|
64
|
-
Initial commit of the new capistrano utility
|
65
|
-
|
66
|
-
------------------------------------------------------------------------
|
67
|
-
MSG
|
68
|
-
@scm.story = [ @log_msg ]
|
69
|
-
end
|
70
|
-
|
71
|
-
def test_latest_revision
|
72
|
-
@scm.story = [ @log_msg ]
|
73
|
-
assert_equal "1967", @scm.latest_revision
|
74
|
-
assert_equal "/hello/world", @scm.last_path
|
75
|
-
end
|
76
|
-
|
77
|
-
def test_checkout
|
78
|
-
@actor.story = []
|
79
|
-
assert_nothing_raised { @scm.checkout(@actor) }
|
80
|
-
assert_nil @actor.channels.last.sent_data
|
81
|
-
assert_match %r{/path/to/svn\b.*\bco\b.* -q}, @actor.command
|
82
|
-
end
|
83
|
-
|
84
|
-
def test_checkout_via_export
|
85
|
-
@actor.story = []
|
86
|
-
@config[:checkout] = "export"
|
87
|
-
assert_nothing_raised { @scm.checkout(@actor) }
|
88
|
-
assert_nil @actor.channels.last.sent_data
|
89
|
-
assert_match %r{/path/to/svn\b.*\bexport\b.* -q}, @actor.command
|
90
|
-
end
|
91
|
-
|
92
|
-
def test_update
|
93
|
-
@actor.story = []
|
94
|
-
assert_nothing_raised { @scm.update(@actor) }
|
95
|
-
assert_nil @actor.channels.last.sent_data
|
96
|
-
assert_match %r{/path/to/svn\b.*\bup\b}, @actor.command
|
97
|
-
end
|
98
|
-
|
99
|
-
def test_checkout_needs_ssh_password
|
100
|
-
@actor.story = [[:out, "Password: "]]
|
101
|
-
assert_nothing_raised { @scm.checkout(@actor) }
|
102
|
-
assert_equal ["chocolatebrownies\n"], @actor.channels.last.sent_data
|
103
|
-
end
|
104
|
-
|
105
|
-
def test_checkout_needs_http_password
|
106
|
-
@actor.story = [[:out, "Password for (something): "]]
|
107
|
-
assert_nothing_raised { @scm.checkout(@actor) }
|
108
|
-
assert_equal ["chocolatebrownies\n"], @actor.channels.last.sent_data
|
109
|
-
end
|
110
|
-
|
111
|
-
def test_checkout_needs_https_certificate
|
112
|
-
@actor.story = [[:out, "(R)eject, accept (t)emporarily or accept (p)ermanently? "]]
|
113
|
-
assert_nothing_raised { @scm.checkout(@actor) }
|
114
|
-
assert_equal ["t\n"], @actor.channels.last.sent_data
|
115
|
-
end
|
116
|
-
|
117
|
-
def test_checkout_needs_alternative_ssh_password
|
118
|
-
@actor.story = [[:out, "someone's password: "]]
|
119
|
-
assert_nothing_raised { @scm.checkout(@actor) }
|
120
|
-
assert_equal ["chocolatebrownies\n"], @actor.channels.last.sent_data
|
121
|
-
end
|
122
|
-
|
123
|
-
def test_svn_password
|
124
|
-
@config[:svn_password] = "butterscotchcandies"
|
125
|
-
@actor.story = [[:out, "Password: "]]
|
126
|
-
assert_nothing_raised { @scm.checkout(@actor) }
|
127
|
-
assert_equal ["butterscotchcandies\n"], @actor.channels.last.sent_data
|
128
|
-
end
|
129
|
-
|
130
|
-
def test_svn_username
|
131
|
-
@actor.story = []
|
132
|
-
@config[:svn_username] = "turtledove"
|
133
|
-
assert_nothing_raised { @scm.checkout(@actor) }
|
134
|
-
assert_nil @actor.channels.last.sent_data
|
135
|
-
assert_match %r{/path/to/svn\b.*\bco\b.* --username turtledove}, @actor.command
|
136
|
-
end
|
137
|
-
|
138
|
-
def test_svn_no_auth_cache
|
139
|
-
@actor.story = []
|
140
|
-
@config[:svn_username] = "turtledove"
|
141
|
-
assert_nothing_raised { @scm.checkout(@actor) }
|
142
|
-
assert_nil @actor.channels.last.sent_data
|
143
|
-
assert_match %r{/path/to/svn\b.*\bco\b.* --no-auth-cache --username turtledove}, @actor.command
|
144
|
-
end
|
145
|
-
end
|