capistrano 3.0.1 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +5 -2
  4. data/CHANGELOG.md +36 -3
  5. data/CONTRIBUTING.md +91 -0
  6. data/Gemfile +9 -0
  7. data/README.md +9 -11
  8. data/capistrano.gemspec +5 -8
  9. data/features/configuration.feature +15 -0
  10. data/features/deploy.feature +1 -0
  11. data/features/deploy_failure.feature +17 -0
  12. data/features/step_definitions/assertions.rb +19 -0
  13. data/features/step_definitions/cap_commands.rb +5 -1
  14. data/features/step_definitions/setup.rb +13 -0
  15. data/features/support/remote_command_helpers.rb +4 -0
  16. data/lib/capistrano/application.rb +41 -3
  17. data/lib/capistrano/configuration.rb +8 -0
  18. data/lib/capistrano/configuration/server.rb +28 -5
  19. data/lib/capistrano/configuration/servers.rb +3 -6
  20. data/lib/capistrano/configuration/servers/host_filter.rb +82 -0
  21. data/lib/capistrano/dsl.rb +16 -1
  22. data/lib/capistrano/dsl/env.rb +11 -1
  23. data/lib/capistrano/dsl/paths.rb +8 -0
  24. data/lib/capistrano/dsl/stages.rb +8 -1
  25. data/lib/capistrano/dsl/task_enhancements.rb +13 -2
  26. data/lib/capistrano/git.rb +35 -0
  27. data/lib/capistrano/hg.rb +32 -0
  28. data/lib/capistrano/i18n.rb +6 -2
  29. data/lib/capistrano/scm.rb +116 -0
  30. data/lib/capistrano/setup.rb +4 -3
  31. data/lib/capistrano/tasks/console.rake +9 -1
  32. data/lib/capistrano/tasks/deploy.rake +17 -15
  33. data/lib/capistrano/tasks/framework.rake +1 -0
  34. data/lib/capistrano/tasks/git.rake +16 -10
  35. data/lib/capistrano/tasks/hg.rake +13 -9
  36. data/lib/capistrano/templates/Capfile +1 -2
  37. data/lib/capistrano/templates/deploy.rb.erb +20 -2
  38. data/lib/capistrano/templates/stage.rb.erb +1 -4
  39. data/lib/capistrano/version.rb +1 -1
  40. data/spec/integration/dsl_spec.rb +147 -2
  41. data/spec/lib/capistrano/application_spec.rb +2 -5
  42. data/spec/lib/capistrano/configuration/server_spec.rb +40 -4
  43. data/spec/lib/capistrano/configuration/servers/host_filter_spec.rb +84 -0
  44. data/spec/lib/capistrano/configuration/servers_spec.rb +35 -0
  45. data/spec/lib/capistrano/configuration_spec.rb +8 -0
  46. data/spec/lib/capistrano/dsl_spec.rb +0 -11
  47. data/spec/lib/capistrano/git_spec.rb +70 -0
  48. data/spec/lib/capistrano/hg_spec.rb +70 -0
  49. data/spec/lib/capistrano/scm_spec.rb +104 -0
  50. data/spec/support/tasks/fail.cap +7 -0
  51. data/spec/support/tasks/failed.cap +5 -0
  52. data/spec/support/test_app.rb +33 -3
  53. metadata +29 -52
  54. data/spec/lib/capistrano/dsl/env_spec.rb +0 -10
@@ -0,0 +1,7 @@
1
+ set :fail, proc { fail }
2
+ before 'deploy:starting', :fail do
3
+ on roles :all do
4
+ execute :touch, shared_path.join('fail')
5
+ end
6
+ fetch(:fail)
7
+ end
@@ -0,0 +1,5 @@
1
+ after 'deploy:failed', :failed do
2
+ on roles :all do
3
+ execute :touch, shared_path.join('failed')
4
+ end
5
+ end
@@ -8,10 +8,9 @@ module TestApp
8
8
 
9
9
  def default_config
10
10
  %{
11
- set :stage, :#{stage}
12
11
  set :deploy_to, '#{deploy_to}'
13
12
  set :repo_url, 'git://github.com/capistrano/capistrano.git'
14
- set :branch, 'v3'
13
+ set :branch, 'master'
15
14
  set :ssh_options, { keys: "\#{ENV['HOME']}/.vagrant.d/insecure_private_key" }
16
15
  server 'vagrant@localhost:2220', roles: %w{web app}
17
16
  set :linked_files, #{linked_files}
@@ -58,6 +57,14 @@ module TestApp
58
57
  end
59
58
  end
60
59
 
60
+ def prepend_to_capfile(config)
61
+ current_capfile = File.read(capfile)
62
+ File.open(capfile, 'w') do |file|
63
+ file.write config
64
+ file.write current_capfile
65
+ end
66
+ end
67
+
61
68
  def create_shared_directory(path)
62
69
  FileUtils.mkdir_p(shared_path.join(path))
63
70
  end
@@ -67,9 +74,14 @@ module TestApp
67
74
  end
68
75
 
69
76
  def cap(task)
77
+ run "bundle exec cap #{stage} #{task}"
78
+ end
79
+
80
+ def run(command)
70
81
  Dir.chdir(test_app_path) do
71
- %x[bundle exec cap #{stage} #{task}]
82
+ %x[#{command}]
72
83
  end
84
+ $?.success?
73
85
  end
74
86
 
75
87
  def stage
@@ -135,4 +147,22 @@ module TestApp
135
147
  def copy_task_to_test_app(source)
136
148
  FileUtils.cp(source, task_dir)
137
149
  end
150
+
151
+ def config_path
152
+ test_app_path.join('config')
153
+ end
154
+
155
+ def move_configuration_to_custom_location(location)
156
+ prepend_to_capfile(
157
+ %{
158
+ set :stage_config_path, "app/config/deploy"
159
+ set :deploy_config_path, "app/config/deploy.rb"
160
+ }
161
+ )
162
+
163
+ location = test_app_path.join(location)
164
+ FileUtils.mkdir_p(location)
165
+ FileUtils.mv(config_path, location)
166
+ end
167
+
138
168
  end
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: 3.0.1
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Clements
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-02 00:00:00.000000000 Z
12
+ date: 2014-01-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sshkit
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - '>='
18
+ - - ~>
19
19
  - !ruby/object:Gem::Version
20
- version: 0.0.23
20
+ version: '1.3'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - '>='
25
+ - - ~>
26
26
  - !ruby/object:Gem::Version
27
- version: 0.0.23
27
+ version: '1.3'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -81,48 +81,6 @@ dependencies:
81
81
  - - '>='
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
- - !ruby/object:Gem::Dependency
85
- name: vagrant
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - ~>
89
- - !ruby/object:Gem::Version
90
- version: 1.0.7
91
- type: :development
92
- prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - ~>
96
- - !ruby/object:Gem::Version
97
- version: 1.0.7
98
- - !ruby/object:Gem::Dependency
99
- name: kuroko
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - '>='
103
- - !ruby/object:Gem::Version
104
- version: '0'
105
- type: :development
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - '>='
110
- - !ruby/object:Gem::Version
111
- version: '0'
112
- - !ruby/object:Gem::Dependency
113
- name: cucumber
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - '>='
117
- - !ruby/object:Gem::Version
118
- version: '0'
119
- type: :development
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - '>='
124
- - !ruby/object:Gem::Version
125
- version: '0'
126
84
  description: Capistrano is a utility and framework for executing commands in parallel
127
85
  on multiple remote machines, via SSH.
128
86
  email:
@@ -137,6 +95,7 @@ files:
137
95
  - .gitignore
138
96
  - .travis.yml
139
97
  - CHANGELOG.md
98
+ - CONTRIBUTING.md
140
99
  - Gemfile
141
100
  - LICENSE.txt
142
101
  - README.md
@@ -145,7 +104,9 @@ files:
145
104
  - bin/capify
146
105
  - capistrano-public_cert.pem
147
106
  - capistrano.gemspec
107
+ - features/configuration.feature
148
108
  - features/deploy.feature
109
+ - features/deploy_failure.feature
149
110
  - features/installation.feature
150
111
  - features/remote_file_task.feature
151
112
  - features/step_definitions/assertions.rb
@@ -161,6 +122,7 @@ files:
161
122
  - lib/capistrano/configuration/question.rb
162
123
  - lib/capistrano/configuration/server.rb
163
124
  - lib/capistrano/configuration/servers.rb
125
+ - lib/capistrano/configuration/servers/host_filter.rb
164
126
  - lib/capistrano/configuration/servers/role_filter.rb
165
127
  - lib/capistrano/console.rb
166
128
  - lib/capistrano/defaults.rb
@@ -176,6 +138,7 @@ files:
176
138
  - lib/capistrano/hg.rb
177
139
  - lib/capistrano/i18n.rb
178
140
  - lib/capistrano/install.rb
141
+ - lib/capistrano/scm.rb
179
142
  - lib/capistrano/setup.rb
180
143
  - lib/capistrano/tasks/console.rake
181
144
  - lib/capistrano/tasks/deploy.rake
@@ -193,12 +156,15 @@ files:
193
156
  - spec/lib/capistrano/application_spec.rb
194
157
  - spec/lib/capistrano/configuration/question_spec.rb
195
158
  - spec/lib/capistrano/configuration/server_spec.rb
159
+ - spec/lib/capistrano/configuration/servers/host_filter_spec.rb
196
160
  - spec/lib/capistrano/configuration/servers/role_filter_spec.rb
197
161
  - spec/lib/capistrano/configuration/servers_spec.rb
198
162
  - spec/lib/capistrano/configuration_spec.rb
199
- - spec/lib/capistrano/dsl/env_spec.rb
200
163
  - spec/lib/capistrano/dsl/paths_spec.rb
201
164
  - spec/lib/capistrano/dsl_spec.rb
165
+ - spec/lib/capistrano/git_spec.rb
166
+ - spec/lib/capistrano/hg_spec.rb
167
+ - spec/lib/capistrano/scm_spec.rb
202
168
  - spec/lib/capistrano/version_validator_spec.rb
203
169
  - spec/lib/capistrano_spec.rb
204
170
  - spec/spec_helper.rb
@@ -206,13 +172,17 @@ files:
206
172
  - spec/support/Vagrantfile
207
173
  - spec/support/matchers.rb
208
174
  - spec/support/tasks/database.cap
175
+ - spec/support/tasks/fail.cap
176
+ - spec/support/tasks/failed.cap
209
177
  - spec/support/test_app.rb
210
178
  homepage: http://capistranorb.com/
211
179
  licenses:
212
180
  - MIT
213
181
  metadata: {}
214
- post_install_message: 'If you''re updating Capistrano from 2.x.x, we recommend you
215
- to read the upgrade guide: http://www.capistranorb.com/documentation/upgrading/'
182
+ post_install_message: |
183
+ Capistrano 3.1 has some breaking changes, like `deploy:restart` callback should be added manually to your deploy.rb. Please, check the CHANGELOG: http://goo.gl/SxB0lr
184
+
185
+ If you're upgrading Capistrano from 2.x, we recommend to read the upgrade guide: http://goo.gl/4536kB
216
186
  rdoc_options: []
217
187
  require_paths:
218
188
  - lib
@@ -233,7 +203,9 @@ signing_key:
233
203
  specification_version: 4
234
204
  summary: Capistrano - Welcome to easy deployment with Ruby over SSH
235
205
  test_files:
206
+ - features/configuration.feature
236
207
  - features/deploy.feature
208
+ - features/deploy_failure.feature
237
209
  - features/installation.feature
238
210
  - features/remote_file_task.feature
239
211
  - features/step_definitions/assertions.rb
@@ -246,12 +218,15 @@ test_files:
246
218
  - spec/lib/capistrano/application_spec.rb
247
219
  - spec/lib/capistrano/configuration/question_spec.rb
248
220
  - spec/lib/capistrano/configuration/server_spec.rb
221
+ - spec/lib/capistrano/configuration/servers/host_filter_spec.rb
249
222
  - spec/lib/capistrano/configuration/servers/role_filter_spec.rb
250
223
  - spec/lib/capistrano/configuration/servers_spec.rb
251
224
  - spec/lib/capistrano/configuration_spec.rb
252
- - spec/lib/capistrano/dsl/env_spec.rb
253
225
  - spec/lib/capistrano/dsl/paths_spec.rb
254
226
  - spec/lib/capistrano/dsl_spec.rb
227
+ - spec/lib/capistrano/git_spec.rb
228
+ - spec/lib/capistrano/hg_spec.rb
229
+ - spec/lib/capistrano/scm_spec.rb
255
230
  - spec/lib/capistrano/version_validator_spec.rb
256
231
  - spec/lib/capistrano_spec.rb
257
232
  - spec/spec_helper.rb
@@ -259,5 +234,7 @@ test_files:
259
234
  - spec/support/Vagrantfile
260
235
  - spec/support/matchers.rb
261
236
  - spec/support/tasks/database.cap
237
+ - spec/support/tasks/fail.cap
238
+ - spec/support/tasks/failed.cap
262
239
  - spec/support/test_app.rb
263
240
  has_rdoc:
@@ -1,10 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module Capistrano
4
- module DSL
5
-
6
- describe Env do
7
-
8
- end
9
- end
10
- end