capistrano 3.0.0.pre2 → 3.0.0.pre3
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +5 -0
- data/README.md +108 -4
- data/lib/capistrano/application.rb +16 -1
- data/lib/capistrano/configuration.rb +12 -17
- data/lib/capistrano/configuration/server.rb +68 -3
- data/lib/capistrano/configuration/servers.rb +71 -28
- data/lib/capistrano/dsl.rb +2 -0
- data/lib/capistrano/dsl/env.rb +7 -4
- data/lib/capistrano/i18n.rb +2 -1
- data/lib/capistrano/tasks/deploy.rake +3 -6
- data/lib/capistrano/templates/Capfile +4 -0
- data/lib/capistrano/version.rb +1 -1
- data/spec/integration/deploy_finalize_spec.rb +34 -0
- data/spec/integration/deploy_finished_spec.rb +36 -0
- data/spec/integration/deploy_started_spec.rb +74 -0
- data/spec/integration/deploy_update_spec.rb +45 -0
- data/spec/integration/dsl_spec.rb +254 -0
- data/spec/integration/installation_spec.rb +76 -0
- data/spec/integration_spec_helper.rb +7 -0
- data/spec/lib/capistrano/application_spec.rb +61 -0
- data/spec/lib/capistrano/configuration/server_spec.rb +91 -0
- data/spec/lib/capistrano/configuration/servers_spec.rb +79 -11
- data/spec/lib/capistrano/configuration_spec.rb +12 -2
- data/spec/lib/capistrano/dsl/env_spec.rb +0 -73
- data/spec/spec_helper.rb +2 -0
- data/spec/support/matchers.rb +5 -0
- data/spec/support/test_app.rb +89 -0
- metadata +24 -2
data/spec/spec_helper.rb
CHANGED
@@ -9,6 +9,8 @@ require 'mocha/api'
|
|
9
9
|
Dir['#{File.dirname(__FILE__)}/support/**/*.rb'].each {|f| require f}
|
10
10
|
|
11
11
|
RSpec.configure do |config|
|
12
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
12
13
|
config.mock_framework = :mocha
|
13
14
|
config.order = 'random'
|
15
|
+
config.filter_run_excluding :slow
|
14
16
|
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
module TestApp
|
3
|
+
def create_test_app
|
4
|
+
[test_app_path, deploy_to].each do |path|
|
5
|
+
FileUtils.rm_rf(path)
|
6
|
+
FileUtils.mkdir(path)
|
7
|
+
end
|
8
|
+
|
9
|
+
File.open(gemfile, 'w+') do |file|
|
10
|
+
file.write "gem 'capistrano', path: '#{path_to_cap}'"
|
11
|
+
end
|
12
|
+
|
13
|
+
Dir.chdir(test_app_path) do
|
14
|
+
%x[bundle]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def install_test_app_with(config)
|
19
|
+
create_test_app
|
20
|
+
Dir.chdir(test_app_path) do
|
21
|
+
%x[bundle exec cap install STAGES=#{stage}]
|
22
|
+
end
|
23
|
+
write_local_deploy_file(config)
|
24
|
+
end
|
25
|
+
|
26
|
+
def write_local_deploy_file(config)
|
27
|
+
File.open(test_stage_path, 'w') do |file|
|
28
|
+
file.write config
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def create_shared_directory(path)
|
33
|
+
FileUtils.mkdir_p(shared_path.join(path))
|
34
|
+
end
|
35
|
+
|
36
|
+
def create_shared_file(path)
|
37
|
+
File.open(shared_path.join(path), 'w')
|
38
|
+
end
|
39
|
+
|
40
|
+
def cap(task)
|
41
|
+
Dir.chdir(test_app_path) do
|
42
|
+
%x[bundle exec cap #{stage} #{task}]
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def stage
|
47
|
+
'test'
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_stage_path
|
51
|
+
test_app_path.join('config/deploy/test.rb')
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_app_path
|
55
|
+
Pathname.new('/tmp/test_app')
|
56
|
+
end
|
57
|
+
|
58
|
+
def deploy_to
|
59
|
+
Pathname.new('/tmp/test_app/deploy_to')
|
60
|
+
end
|
61
|
+
|
62
|
+
def shared_path
|
63
|
+
deploy_to.join('shared')
|
64
|
+
end
|
65
|
+
|
66
|
+
def current_path
|
67
|
+
deploy_to.join('current')
|
68
|
+
end
|
69
|
+
|
70
|
+
def releases_path
|
71
|
+
deploy_to.join('releases')
|
72
|
+
end
|
73
|
+
|
74
|
+
def release_path
|
75
|
+
releases_path.join(Dir.entries(releases_path).last)
|
76
|
+
end
|
77
|
+
|
78
|
+
def path_to_cap
|
79
|
+
File.expand_path('.')
|
80
|
+
end
|
81
|
+
|
82
|
+
def gemfile
|
83
|
+
test_app_path.join('Gemfile')
|
84
|
+
end
|
85
|
+
|
86
|
+
def current_user
|
87
|
+
`whoami`.chomp
|
88
|
+
end
|
89
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.
|
4
|
+
version: 3.0.0.pre3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Clements
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sshkit
|
@@ -89,6 +89,7 @@ extensions: []
|
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
91
|
- .gitignore
|
92
|
+
- .travis.yml
|
92
93
|
- Gemfile
|
93
94
|
- LICENSE.txt
|
94
95
|
- README.md
|
@@ -127,6 +128,14 @@ files:
|
|
127
128
|
- lib/capistrano/templates/deploy.rb.erb
|
128
129
|
- lib/capistrano/templates/stage.rb.erb
|
129
130
|
- lib/capistrano/version.rb
|
131
|
+
- spec/integration/deploy_finalize_spec.rb
|
132
|
+
- spec/integration/deploy_finished_spec.rb
|
133
|
+
- spec/integration/deploy_started_spec.rb
|
134
|
+
- spec/integration/deploy_update_spec.rb
|
135
|
+
- spec/integration/dsl_spec.rb
|
136
|
+
- spec/integration/installation_spec.rb
|
137
|
+
- spec/integration_spec_helper.rb
|
138
|
+
- spec/lib/capistrano/application_spec.rb
|
130
139
|
- spec/lib/capistrano/configuration/question_spec.rb
|
131
140
|
- spec/lib/capistrano/configuration/server_spec.rb
|
132
141
|
- spec/lib/capistrano/configuration/servers_spec.rb
|
@@ -136,6 +145,8 @@ files:
|
|
136
145
|
- spec/lib/capistrano/dsl_spec.rb
|
137
146
|
- spec/lib/capistrano_spec.rb
|
138
147
|
- spec/spec_helper.rb
|
148
|
+
- spec/support/matchers.rb
|
149
|
+
- spec/support/test_app.rb
|
139
150
|
homepage: ''
|
140
151
|
licenses: []
|
141
152
|
metadata: {}
|
@@ -160,6 +171,14 @@ signing_key:
|
|
160
171
|
specification_version: 4
|
161
172
|
summary: 'PENDING: Write a gem summary'
|
162
173
|
test_files:
|
174
|
+
- spec/integration/deploy_finalize_spec.rb
|
175
|
+
- spec/integration/deploy_finished_spec.rb
|
176
|
+
- spec/integration/deploy_started_spec.rb
|
177
|
+
- spec/integration/deploy_update_spec.rb
|
178
|
+
- spec/integration/dsl_spec.rb
|
179
|
+
- spec/integration/installation_spec.rb
|
180
|
+
- spec/integration_spec_helper.rb
|
181
|
+
- spec/lib/capistrano/application_spec.rb
|
163
182
|
- spec/lib/capistrano/configuration/question_spec.rb
|
164
183
|
- spec/lib/capistrano/configuration/server_spec.rb
|
165
184
|
- spec/lib/capistrano/configuration/servers_spec.rb
|
@@ -169,3 +188,6 @@ test_files:
|
|
169
188
|
- spec/lib/capistrano/dsl_spec.rb
|
170
189
|
- spec/lib/capistrano_spec.rb
|
171
190
|
- spec/spec_helper.rb
|
191
|
+
- spec/support/matchers.rb
|
192
|
+
- spec/support/test_app.rb
|
193
|
+
has_rdoc:
|