capistrano 3.7.0.beta1 → 3.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -1
- data/CHANGELOG.md +27 -1
- data/Dangerfile +54 -0
- data/README.md +1 -1
- data/capistrano.gemspec +2 -1
- data/lib/capistrano/configuration.rb +18 -1
- data/lib/capistrano/i18n.rb +1 -0
- data/lib/capistrano/tasks/deploy.rake +4 -2
- data/lib/capistrano/templates/stage.rb.erb +1 -1
- data/lib/capistrano/version.rb +1 -1
- data/spec/lib/capistrano/configuration_spec.rb +49 -0
- metadata +21 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce22b5f5826e88b5fd92b3369c02344f20e2191e
|
4
|
+
data.tar.gz: 491397aab719879777bec4153c3125575f86e62a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37864d78dd2d14478f0e9edcb316ac5e68fe5dc83b02bfd4017b1790350b26d1c929f6b94890fe351101fd05257f4bf8ce427fb8f5be0d1758e36e48fcc70fd5
|
7
|
+
data.tar.gz: 6eec3f49c1e4867137d3d266d533c44bcba2bc076d1e8d003e51bcc8735a14f613ef8c49a86f69417cd40deca95b2827115885289113e490ea8bf0940639c50b
|
data/.travis.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 2.3.
|
3
|
+
- 2.3.1
|
4
4
|
- 2.2
|
5
5
|
- 2.1
|
6
6
|
- 2.0
|
@@ -13,6 +13,10 @@ matrix:
|
|
13
13
|
include:
|
14
14
|
- rvm: rbx-2
|
15
15
|
script: bundle exec rake spec
|
16
|
+
# Run Danger only once, on 2.3.1
|
17
|
+
- rvm: 2.3.1
|
18
|
+
before_script: bundle exec danger
|
19
|
+
|
16
20
|
script: bundle exec rake spec rubocop
|
17
21
|
install: bundle install --jobs=1
|
18
22
|
cache: bundler
|
data/CHANGELOG.md
CHANGED
@@ -4,10 +4,36 @@ Reverse Chronological Order:
|
|
4
4
|
|
5
5
|
## master
|
6
6
|
|
7
|
-
https://github.com/capistrano/capistrano/compare/v3.7.0
|
7
|
+
https://github.com/capistrano/capistrano/compare/v3.7.0...HEAD
|
8
8
|
|
9
9
|
* Your contribution here!
|
10
10
|
|
11
|
+
## `3.7.0` (2016-12-10)
|
12
|
+
|
13
|
+
https://github.com/capistrano/capistrano/compare/v3.6.1...v3.7.0
|
14
|
+
|
15
|
+
*Note: These release notes include all changes since 3.6.1, including the changes that were first published in 3.7.0.beta1.*
|
16
|
+
|
17
|
+
### Deprecations:
|
18
|
+
|
19
|
+
* The `set :scm, ...` mechanism is now deprecated in favor of a new SCM plugin system. See the [UPGRADING-3.7](UPGRADING-3.7.md) document for details
|
20
|
+
|
21
|
+
### Potentially breaking changes:
|
22
|
+
|
23
|
+
* The `:git_strategy`, `:hg_strategy`, and `:svn_strategy` settings have been removed with no replacement. If you have been using these to customize Capistrano's SCM behavior, you will need to rewrite your customization using the [new plugin system](http://capistranorb.com/documentation/advanced-features/custom-scm/)
|
24
|
+
* `remote_file` feature has been removed and is no longer available to use @SaiVardhan
|
25
|
+
|
26
|
+
### New features:
|
27
|
+
|
28
|
+
* The `tar` used by the Git SCM now honors the SSHKit command map, allowing an alternative tar binary to be used (e.g. gtar) #1787 (@caius)
|
29
|
+
* Add support for custom on-filters [#1776](https://github.com/capistrano/capistrano/issues/1776)
|
30
|
+
|
31
|
+
### Fixes:
|
32
|
+
|
33
|
+
* Fix test suite to work with Mocha 1.2.0 (@caius)
|
34
|
+
* Fix bug where host_filter and role_filter were overly greedy [#1766](https://github.com/capistrano/capistrano/issues/1766) (@cseeger-epages)
|
35
|
+
* Fix the removal of old releases `deploy:cleanup`. Logic is changed because of unreliable modification times on folders. Removal of directories is now decided by sorting on folder names (name is generated from current datetime format YmdHis). Cleanup is skipped, and a warning is given when a folder name is in a different format
|
36
|
+
|
11
37
|
## `3.7.0.beta1` (2016-11-02)
|
12
38
|
|
13
39
|
https://github.com/capistrano/capistrano/compare/v3.6.1...v3.7.0.beta1
|
data/Dangerfile
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# Adapted from https://github.com/ruby-grape/danger/blob/master/Dangerfile
|
2
|
+
# Q: What is a Dangerfile, anyway? A: See http://danger.systems/
|
3
|
+
|
4
|
+
# ------------------------------------------------------------------------------
|
5
|
+
# Additional pull request data
|
6
|
+
# ------------------------------------------------------------------------------
|
7
|
+
project_name = github.pr_json["base"]["repo"]["name"]
|
8
|
+
pr_number = github.pr_json["number"]
|
9
|
+
pr_url = github.pr_json["_links"]["html"]["href"]
|
10
|
+
|
11
|
+
# ------------------------------------------------------------------------------
|
12
|
+
# What changed?
|
13
|
+
# ------------------------------------------------------------------------------
|
14
|
+
has_lib_changes = !git.modified_files.grep(/^lib/).empty?
|
15
|
+
has_test_changes = !git.modified_files.grep(/^(features|spec)/).empty?
|
16
|
+
has_changelog_changes = git.modified_files.include?("CHANGELOG.md")
|
17
|
+
|
18
|
+
# ------------------------------------------------------------------------------
|
19
|
+
# You've made changes to lib, but didn't write any tests?
|
20
|
+
# ------------------------------------------------------------------------------
|
21
|
+
if has_lib_changes && !has_test_changes
|
22
|
+
warn("There are code changes, but no corresponding tests. "\
|
23
|
+
"Please include tests if this PR introduces any modifications in "\
|
24
|
+
"#{project_name}'s behavior.",
|
25
|
+
:sticky => false)
|
26
|
+
end
|
27
|
+
|
28
|
+
# ------------------------------------------------------------------------------
|
29
|
+
# Have you updated CHANGELOG.md?
|
30
|
+
# ------------------------------------------------------------------------------
|
31
|
+
if !has_changelog_changes && has_lib_changes
|
32
|
+
markdown <<-MARKDOWN
|
33
|
+
Here's an example of a CHANGELOG.md entry (place it immediately under the `* Your contribution here!` line):
|
34
|
+
|
35
|
+
```markdown
|
36
|
+
* [##{pr_number}](#{pr_url}): #{github.pr_title} - [@#{github.pr_author}](https://github.com/#{github.pr_author}).
|
37
|
+
```
|
38
|
+
MARKDOWN
|
39
|
+
warn("Please update CHANGELOG.md with a description of your changes. "\
|
40
|
+
"If this PR is not a user-facing change (e.g. just refactoring), "\
|
41
|
+
"you can disregard this.", :sticky => false)
|
42
|
+
end
|
43
|
+
|
44
|
+
# ------------------------------------------------------------------------------
|
45
|
+
# Did you remove the CHANGELOG's "Your contribution here!" line?
|
46
|
+
# ------------------------------------------------------------------------------
|
47
|
+
if has_changelog_changes
|
48
|
+
unless IO.read("CHANGELOG.md") =~ /^\* Your contribution here/i
|
49
|
+
fail(
|
50
|
+
"Please put the `* Your contribution here!` line back into CHANGELOG.md.",
|
51
|
+
:sticky => false
|
52
|
+
)
|
53
|
+
end
|
54
|
+
end
|
data/README.md
CHANGED
data/capistrano.gemspec
CHANGED
@@ -26,7 +26,8 @@ Gem::Specification.new do |gem|
|
|
26
26
|
gem.add_dependency "sshkit", ">= 1.9.0"
|
27
27
|
gem.add_dependency "capistrano-harrow"
|
28
28
|
|
29
|
-
gem.add_development_dependency "
|
29
|
+
gem.add_development_dependency "danger"
|
30
30
|
gem.add_development_dependency "mocha"
|
31
|
+
gem.add_development_dependency "rspec"
|
31
32
|
gem.add_development_dependency "rubocop"
|
32
33
|
end
|
@@ -110,8 +110,25 @@ module Capistrano
|
|
110
110
|
@timestamp ||= Time.now.utc
|
111
111
|
end
|
112
112
|
|
113
|
+
def add_filter(filter=nil, &block)
|
114
|
+
if block
|
115
|
+
raise ArgumentError, "Both a block and an object were given" if filter
|
116
|
+
|
117
|
+
filter = Object.new
|
118
|
+
def filter.filter(servers)
|
119
|
+
block.call(servers)
|
120
|
+
end
|
121
|
+
elsif !filter.respond_to? :filter
|
122
|
+
raise TypeError, "Provided custom filter <#{filter.inspect}> does " \
|
123
|
+
"not have a public 'filter' method"
|
124
|
+
end
|
125
|
+
@custom_filters ||= []
|
126
|
+
@custom_filters << filter
|
127
|
+
end
|
128
|
+
|
113
129
|
def setup_filters
|
114
|
-
@filters = cmdline_filters
|
130
|
+
@filters = cmdline_filters
|
131
|
+
@filters += @custom_filters if @custom_filters
|
115
132
|
@filters << Filter.new(:role, ENV["ROLES"]) if ENV["ROLES"]
|
116
133
|
@filters << Filter.new(:host, ENV["HOSTS"]) if ENV["HOSTS"]
|
117
134
|
fh = fetch_for(:filter, {}) || {}
|
data/lib/capistrano/i18n.rb
CHANGED
@@ -12,6 +12,7 @@ en = {
|
|
12
12
|
written_file: "create %{file}",
|
13
13
|
question: "Please enter %{key} (%{default_value}): ",
|
14
14
|
keeping_releases: "Keeping %{keep_releases} of %{releases} deployed releases on %{host}",
|
15
|
+
skip_cleanup: "Skipping cleanup of old releases on %{host}; unexpected foldername found (should be timestamp)",
|
15
16
|
no_old_releases: "No old releases (keeping newest %{keep_releases}) on %{host}",
|
16
17
|
linked_file_does_not_exist: "linked file %{file} does not exist on %{host}",
|
17
18
|
cannot_rollback: "There are no older releases to rollback to",
|
@@ -148,8 +148,10 @@ namespace :deploy do
|
|
148
148
|
desc "Clean up old releases"
|
149
149
|
task :cleanup do
|
150
150
|
on release_roles :all do |host|
|
151
|
-
releases = capture(:ls, "-
|
152
|
-
if releases.
|
151
|
+
releases = capture(:ls, "-x", releases_path).split
|
152
|
+
if !(releases.all? { |e| /^\d{14}$/ =~ e })
|
153
|
+
warn t(:skip_cleanup, host: host.to_s)
|
154
|
+
elsif releases.count >= fetch(:keep_releases)
|
153
155
|
info t(:keeping_releases, host: host.to_s, keep_releases: fetch(:keep_releases), releases: releases.count)
|
154
156
|
directories = (releases - releases.last(fetch(:keep_releases)))
|
155
157
|
if directories.any?
|
@@ -13,7 +13,7 @@
|
|
13
13
|
# ==================
|
14
14
|
|
15
15
|
# Defines a role with one or multiple servers. The primary server in each
|
16
|
-
# group is considered to be the first unless any
|
16
|
+
# group is considered to be the first unless any hosts have the primary
|
17
17
|
# property set. Specify the username and a domain or IP for the server.
|
18
18
|
# Don't use `:all`, it's a meta role.
|
19
19
|
|
data/lib/capistrano/version.rb
CHANGED
@@ -304,5 +304,54 @@ module Capistrano
|
|
304
304
|
expect(config.dry_run?).to eq(true)
|
305
305
|
end
|
306
306
|
end
|
307
|
+
|
308
|
+
describe "custom filtering" do
|
309
|
+
it "accepts a custom filter object" do
|
310
|
+
filter = Object.new
|
311
|
+
def filter.filter(servers)
|
312
|
+
servers
|
313
|
+
end
|
314
|
+
config.add_filter(filter)
|
315
|
+
end
|
316
|
+
|
317
|
+
it "accepts a custom filter as a block" do
|
318
|
+
config.add_filter { |servers| servers }
|
319
|
+
end
|
320
|
+
|
321
|
+
it "raises an error if passed a block and an object" do
|
322
|
+
filter = Object.new
|
323
|
+
def filter.filter(servers)
|
324
|
+
servers
|
325
|
+
end
|
326
|
+
|
327
|
+
expect { config.add_filter(filter) { |servers| servers } }.to raise_error(ArgumentError)
|
328
|
+
end
|
329
|
+
|
330
|
+
it "raises an error if the filter lacks a filter method" do
|
331
|
+
filter = Object.new
|
332
|
+
expect { config.add_filter(filter) }.to raise_error(TypeError)
|
333
|
+
end
|
334
|
+
|
335
|
+
it "calls the filter method of a custom filter" do
|
336
|
+
ENV.delete "ROLES"
|
337
|
+
ENV.delete "HOSTS"
|
338
|
+
|
339
|
+
servers = Configuration::Servers.new
|
340
|
+
|
341
|
+
servers.add_host("test1")
|
342
|
+
servers.add_host("test2")
|
343
|
+
servers.add_host("test3")
|
344
|
+
|
345
|
+
filtered_servers = servers.take(2)
|
346
|
+
|
347
|
+
filter = mock("custom filter")
|
348
|
+
filter.expects(:filter)
|
349
|
+
.with { |subset| subset.is_a? Configuration::Servers }
|
350
|
+
.returns(filtered_servers)
|
351
|
+
|
352
|
+
config.add_filter(filter)
|
353
|
+
expect(config.filter(servers)).to eq(filtered_servers)
|
354
|
+
end
|
355
|
+
end
|
307
356
|
end
|
308
357
|
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.7.0
|
4
|
+
version: 3.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Clements
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-12-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: airbrussh
|
@@ -82,7 +82,7 @@ dependencies:
|
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
|
-
name:
|
85
|
+
name: danger
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
88
|
- - ">="
|
@@ -109,6 +109,20 @@ dependencies:
|
|
109
109
|
- - ">="
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: rspec
|
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'
|
112
126
|
- !ruby/object:Gem::Dependency
|
113
127
|
name: rubocop
|
114
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,6 +156,7 @@ files:
|
|
142
156
|
- CHANGELOG.md
|
143
157
|
- CONTRIBUTING.md
|
144
158
|
- DEVELOPMENT.md
|
159
|
+
- Dangerfile
|
145
160
|
- Gemfile
|
146
161
|
- LICENSE.txt
|
147
162
|
- README.md
|
@@ -277,12 +292,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
277
292
|
version: '2.0'
|
278
293
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
279
294
|
requirements:
|
280
|
-
- - "
|
295
|
+
- - ">="
|
281
296
|
- !ruby/object:Gem::Version
|
282
|
-
version:
|
297
|
+
version: '0'
|
283
298
|
requirements: []
|
284
299
|
rubyforge_project:
|
285
|
-
rubygems_version: 2.6.
|
300
|
+
rubygems_version: 2.6.8
|
286
301
|
signing_key:
|
287
302
|
specification_version: 4
|
288
303
|
summary: Capistrano - Welcome to easy deployment with Ruby over SSH
|