capistrano 3.6.1 → 3.7.0.beta1
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/.github/issue_template.md +19 -0
- data/.github/pull_request_template.md +26 -0
- data/.gitignore +1 -0
- data/.travis.yml +5 -1
- data/CHANGELOG.md +27 -1
- data/DEVELOPMENT.md +7 -1
- data/README.md +3 -4
- data/capistrano.gemspec +1 -1
- data/features/support/vagrant_helpers.rb +3 -5
- data/lib/capistrano/all.rb +1 -0
- data/lib/capistrano/configuration.rb +12 -2
- data/lib/capistrano/configuration/host_filter.rb +1 -1
- data/lib/capistrano/configuration/plugin_installer.rb +20 -2
- data/lib/capistrano/configuration/role_filter.rb +1 -1
- data/lib/capistrano/configuration/scm_resolver.rb +144 -0
- data/lib/capistrano/configuration/validated_variables.rb +3 -4
- data/lib/capistrano/defaults.rb +3 -1
- data/lib/capistrano/doctor/variables_doctor.rb +1 -1
- data/lib/capistrano/dsl/env.rb +2 -9
- data/lib/capistrano/dsl/paths.rb +1 -1
- data/lib/capistrano/dsl/task_enhancements.rb +0 -8
- data/lib/capistrano/scm/git.rb +73 -0
- data/lib/capistrano/scm/hg.rb +48 -0
- data/lib/capistrano/scm/plugin.rb +13 -0
- data/lib/capistrano/scm/svn.rb +47 -0
- data/lib/capistrano/{tasks → scm/tasks}/git.rake +9 -24
- data/lib/capistrano/{tasks → scm/tasks}/hg.rake +11 -10
- data/lib/capistrano/{tasks → scm/tasks}/svn.rake +11 -10
- data/lib/capistrano/setup.rb +1 -1
- data/lib/capistrano/tasks/deploy.rake +0 -3
- data/lib/capistrano/templates/Capfile +18 -7
- data/lib/capistrano/templates/deploy.rb.erb +7 -10
- data/lib/capistrano/templates/stage.rb.erb +7 -7
- data/lib/capistrano/version.rb +1 -1
- data/lib/capistrano/version_validator.rb +2 -5
- data/spec/lib/capistrano/configuration/host_filter_spec.rb +5 -0
- data/spec/lib/capistrano/configuration/plugin_installer_spec.rb +98 -0
- data/spec/lib/capistrano/configuration/role_filter_spec.rb +17 -1
- data/spec/lib/capistrano/doctor/variables_doctor_spec.rb +0 -7
- data/spec/lib/capistrano/dsl/task_enhancements_spec.rb +0 -15
- data/spec/lib/capistrano/scm/git_spec.rb +131 -0
- data/spec/lib/capistrano/scm/hg_spec.rb +104 -0
- data/spec/lib/capistrano/scm/svn_spec.rb +116 -0
- data/spec/lib/capistrano/scm_spec.rb +1 -1
- metadata +23 -20
- data/features/remote_file_task.feature +0 -14
- data/issue_template.md +0 -21
- data/lib/capistrano/git.rb +0 -54
- data/lib/capistrano/hg.rb +0 -43
- data/lib/capistrano/svn.rb +0 -42
- data/spec/lib/capistrano/git_spec.rb +0 -109
- data/spec/lib/capistrano/hg_spec.rb +0 -90
- data/spec/lib/capistrano/svn_spec.rb +0 -105
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e931dfadef610b41da34b4f62e12a7a27c811cd0
|
4
|
+
data.tar.gz: f50c1a957e6a56af182eefe19025021ec94b8e62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5d746ae4fb0ef00e20856e805587be8d1215f692cbb23d10a24a5df90e078a7f1d901909085824d27e9eafb03b5ce85ccf6099ff540d001dc2aac958761fe79
|
7
|
+
data.tar.gz: 491a552e20243bb82c77274d95d726cb0be2e37e6cccb866473b7621cc5549087b3a45cec370957f237c259d6439df77fc0834d71dc7e3fd586639b080dc9fd4
|
@@ -0,0 +1,19 @@
|
|
1
|
+
**Important:** GitHub issues are for feature requests or bug reports. The Capistrano team recommends you use [Stack Overflow](http://stackoverflow.com/questions/tagged/capistrano) for general questions. For more details, please see our [contribution policy](https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md).
|
2
|
+
|
3
|
+
---
|
4
|
+
|
5
|
+
### Steps to reproduce
|
6
|
+
If reasonable, you can help by creating a Capistrano skeleton example project which reproduces the issue you are seeing. You can then upload the individual files to a GitHub Gist or a GitHub project. Others can simply modify the configuration to point at a test server/repository of their own. Often times, an issue is resolved simply by making this test case.
|
7
|
+
|
8
|
+
An example test case is here: https://gist.github.com/will-in-wi/527327e31af30b3eae2068e2965be05b
|
9
|
+
|
10
|
+
### Expected behavior
|
11
|
+
Tell us what should happen
|
12
|
+
|
13
|
+
### Actual behavior
|
14
|
+
Tell us what happens instead
|
15
|
+
|
16
|
+
### System configuration
|
17
|
+
Please link to the output of `cap <stage> doctor` in a GitHub Gist.
|
18
|
+
|
19
|
+
Thanks for helping improve Capistrano!
|
@@ -0,0 +1,26 @@
|
|
1
|
+
### Summary
|
2
|
+
|
3
|
+
(Guidelines for creating a bug report are available
|
4
|
+
here: https://github.com/capistrano/capistrano/blob/master/DEVELOPMENT.md)
|
5
|
+
|
6
|
+
Provide a general description of the code changes in your pull
|
7
|
+
request... were there any bugs you had fixed? If so, mention them. If
|
8
|
+
these bugs have open GitHub issues, be sure to tag them here as well,
|
9
|
+
to keep the conversation linked together.
|
10
|
+
|
11
|
+
### Short checklist
|
12
|
+
|
13
|
+
- [ ] Did you run `bundle exec rubocop -a` to fix linter issues?
|
14
|
+
- [ ] If relevant, did you create a test?
|
15
|
+
- [ ] Did you confirm that the RSpec tests pass?
|
16
|
+
- [ ] If you are fixing a bug or introducing a new feature, did you add a CHANGELOG entry?
|
17
|
+
|
18
|
+
### Other Information
|
19
|
+
|
20
|
+
If there's anything else that's important and relevant to your pull
|
21
|
+
request, mention that information here.
|
22
|
+
|
23
|
+
If you are updating any of the CHANGELOG files or are asked to update the
|
24
|
+
CHANGELOG files by reviewers, please add the CHANGELOG entry at the top of the file where indicated.
|
25
|
+
|
26
|
+
Thanks for helping improve Capistrano!
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -5,8 +5,12 @@ rvm:
|
|
5
5
|
- 2.1
|
6
6
|
- 2.0
|
7
7
|
matrix:
|
8
|
+
# Rubinius periodically fails in general, and it always segfaults for RuboCop
|
9
|
+
# in particular. Until we figure out how to make it work consistently, allow
|
10
|
+
# it to fail without breaking the build.
|
11
|
+
allow_failures:
|
12
|
+
- rvm: rbx-2
|
8
13
|
include:
|
9
|
-
# Run specs on Rubinius, but not RuboCop, since it seg faults
|
10
14
|
- rvm: rbx-2
|
11
15
|
script: bundle exec rake spec
|
12
16
|
script: bundle exec rake spec rubocop
|
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
|
+
https://github.com/capistrano/capistrano/compare/v3.7.0.beta1...HEAD
|
8
8
|
|
9
9
|
* Your contribution here!
|
10
10
|
|
11
|
+
## `3.7.0.beta1` (2016-11-02)
|
12
|
+
|
13
|
+
https://github.com/capistrano/capistrano/compare/v3.6.1...v3.7.0.beta1
|
14
|
+
|
15
|
+
### Deprecations:
|
16
|
+
|
17
|
+
* The `set :scm, ...` mechanism is now deprecated in favor of a new SCM plugin
|
18
|
+
system. See the [UPGRADING-3.7](UPGRADING-3.7.md) document for details.
|
19
|
+
|
20
|
+
### Potentially breaking changes:
|
21
|
+
|
22
|
+
* The `:git_strategy`, `:hg_strategy`, and `:svn_strategy` settings have been
|
23
|
+
removed with no replacement. If you have been using these to customize
|
24
|
+
Capistrano's SCM behavior, you will need to rewrite your customization using
|
25
|
+
the [new plugin system](http://capistranorb.com/documentation/advanced-features/custom-scm/).
|
26
|
+
* `remote_file` feature has been removed and is no longer available to use @SaiVardhan
|
27
|
+
|
28
|
+
### New features:
|
29
|
+
|
30
|
+
* 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)
|
31
|
+
|
32
|
+
### Fixes:
|
33
|
+
|
34
|
+
* Fix test suite to work with Mocha 1.2.0 (@caius)
|
35
|
+
* Fix bug where host_filter and role_filter were overly greedy [#1766](https://github.com/capistrano/capistrano/issues/1766) (@cseeger-epages)
|
36
|
+
|
11
37
|
## `3.6.1` (2016-08-23)
|
12
38
|
|
13
39
|
https://github.com/capistrano/capistrano/compare/v3.6.0...v3.6.1
|
data/DEVELOPMENT.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
Thanks for helping build Capistrano! Here are the development practices followed by our community.
|
2
2
|
|
3
3
|
* [Who can help](#who-can-help)
|
4
|
+
* [Contributing documentation](#contributing-documentation)
|
4
5
|
* [Setting up your development environment](#setting-up-your-development-environment)
|
5
6
|
* [Coding guidelines](#coding-guidelines)
|
6
7
|
* [Submitting a pull request](#submitting-a-pull-request)
|
@@ -17,6 +18,10 @@ Everyone can help improve Capistrano. There are ways to contribute even if you a
|
|
17
18
|
* reviewing pull requests and suggesting improvements
|
18
19
|
* reporting bugs or suggesting new features (see [CONTRIBUTING.md][])
|
19
20
|
|
21
|
+
## Contributing documentation
|
22
|
+
|
23
|
+
Improvements and additions to Capistrano's documentation are very much appreciated. The official documention is stored in the `docs/` directory as Markdown files. These files are used to automatically generate the [capistranorb.com](http://capistranorb.com/) website, which is hosted by GitHub Pages. Feel free to make changes to this documentation as you see fit. Before opening a pull request, make sure your documentation renders correctly by previewing the website in your local environment. Refer to [docs/README.md][] for instructions.
|
24
|
+
|
20
25
|
## Setting up your development environment
|
21
26
|
|
22
27
|
Capistrano is a Ruby project, so we expect you to have a functioning Ruby environment. To hack on Capistrano you will further need some specialized tools to run its test suite.
|
@@ -71,7 +76,7 @@ Your code should conform to these guidelines:
|
|
71
76
|
* We can't merge it without a [good commit message](http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message). If you do this right, Github will use the commit message as the body of your pull request, double win.
|
72
77
|
* If you are making an improvement/fix for an existing issue, make sure to mention the issue number (if we have not yet merged it )
|
73
78
|
* Add an entry to the `CHANGELOG` under the `### master` section, but please don't mess with the version.
|
74
|
-
* If you add a new feature, please make sure to document it
|
79
|
+
* If you add a new feature, please make sure to document it by modifying the appropriate Markdown files in `docs/` (see [contributing documentation](#contributing-documentation), above). If it's a simple feature, or a new variable, or something changed, it may be appropriate simply to document it in the generated `Capfile` or `deploy.rb`, or in the `README`.
|
75
80
|
* Take care to squash your commit into one single commit with a good message, it saves us a lot of work in maintaining the CHANGELOG if we can generate it from the commit messages between the release tags!
|
76
81
|
* Tests! It's tricky to test some parts of Capistrano, but do your best, it might just serve as a starting point for us to build a reliable test on top of, and help us understand where you are coming from.
|
77
82
|
|
@@ -120,3 +125,4 @@ After a pull request is merged, it is assigned to a GitHub milestone for the upc
|
|
120
125
|
|
121
126
|
|
122
127
|
[CONTRIBUTING.md]: https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md
|
128
|
+
[docs/README.md]: https://github.com/capistrano/capistrano/blob/master/docs/README.md
|
data/README.md
CHANGED
@@ -58,7 +58,7 @@ Deploying to a fleet of app servers? Capistrano can run each deployment task con
|
|
58
58
|
|
59
59
|
#### Server roles
|
60
60
|
|
61
|
-
Your application may need many different types of servers: a database server, an app server, two
|
61
|
+
Your application may need many different types of servers: a database server, an app server, two web servers, and a job queue work server, for example. Capistrano lets you tag each server with one or more roles, so you can control what tasks are executed where.
|
62
62
|
|
63
63
|
#### Community driven
|
64
64
|
|
@@ -141,7 +141,7 @@ To customize the stages that are created, use:
|
|
141
141
|
$ bundle exec cap install STAGES=local,sandbox,qa,production
|
142
142
|
```
|
143
143
|
|
144
|
-
Note that the files that Capistrano creates are simply templates to get you started. Make sure to edit the `deploy.rb` and stage files so they contain values appropriate for your project and your target servers.
|
144
|
+
Note that the files that Capistrano creates are simply templates to get you started. Make sure to edit the `deploy.rb` and stage files so that they contain values appropriate for your project and your target servers.
|
145
145
|
|
146
146
|
### Command-line usage
|
147
147
|
|
@@ -173,7 +173,7 @@ $ bundle exec cap production deploy --print-config-variables
|
|
173
173
|
|
174
174
|
Capistrano is a large project encompassing multiple GitHub repositories and a community of plugins, and it can be overwhelming when you are just getting started. Here are resources that can help:
|
175
175
|
|
176
|
-
* **
|
176
|
+
* **The [docs](docs) directory contains the official documentation**, and is used to generate the [Capistrano website](http://capistranorb.com)
|
177
177
|
* [Stack Overflow](http://stackoverflow.com/questions/tagged/capistrano) has a Capistrano tag with lots of activity
|
178
178
|
* [The Capistrano mailing list](https://groups.google.com/forum/#!forum/capistrano) is low-traffic but is monitored by Capistrano contributors
|
179
179
|
* [CodersClan](http://codersclan.net/?repo_id=325&source=link) has Capistrano experts available to solve problems for bounties
|
@@ -181,7 +181,6 @@ Capistrano is a large project encompassing multiple GitHub repositories and a co
|
|
181
181
|
Related GitHub repositories:
|
182
182
|
|
183
183
|
* [capistrano/sshkit](https://github.com/capistrano/sshkit) provides the SSH behavior that underlies Capistrano (when you use `execute` in a Capistrano task, you are using SSHKit)
|
184
|
-
* [capistrano/documentation](https://github.com/capistrano/documentation) is what generates the official Capistrano website
|
185
184
|
* [capistrano/rails](https://github.com/capistrano/rails) is a very popular gem that adds Ruby on Rails deployment tasks
|
186
185
|
* [mattbrictson/airbrussh](https://github.com/mattbrictson/airbrussh) provides Capistrano's default log formatting
|
187
186
|
|
data/capistrano.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.summary = "Capistrano - Welcome to easy deployment with Ruby over SSH"
|
13
13
|
gem.homepage = "http://capistranorb.com/"
|
14
14
|
|
15
|
-
gem.files = `git ls-files -z`.split("\x0")
|
15
|
+
gem.files = `git ls-files -z`.split("\x0").reject { |f| f =~ /^docs/ }
|
16
16
|
gem.executables = %w(cap capify)
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
@@ -25,11 +25,9 @@ module VagrantHelpers
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def run_vagrant_command(command)
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
raise VagrantSSHCommandError, status
|
32
|
-
end
|
28
|
+
status = vagrant_cli_command("ssh -c #{command.inspect}")
|
29
|
+
return true if status.success?
|
30
|
+
raise VagrantSSHCommandError, status
|
33
31
|
end
|
34
32
|
end
|
35
33
|
|
data/lib/capistrano/all.rb
CHANGED
@@ -102,6 +102,10 @@ module Capistrano
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
+
def configure_scm
|
106
|
+
Capistrano::Configuration::SCMResolver.new.resolve
|
107
|
+
end
|
108
|
+
|
105
109
|
def timestamp
|
106
110
|
@timestamp ||= Time.now.utc
|
107
111
|
end
|
@@ -130,8 +134,14 @@ module Capistrano
|
|
130
134
|
fetch(:sshkit_backend) == SSHKit::Backend::Printer
|
131
135
|
end
|
132
136
|
|
133
|
-
def install_plugin(plugin, load_hooks: true)
|
134
|
-
installer.install(plugin,
|
137
|
+
def install_plugin(plugin, load_hooks: true, load_immediately: false)
|
138
|
+
installer.install(plugin,
|
139
|
+
load_hooks: load_hooks,
|
140
|
+
load_immediately: load_immediately)
|
141
|
+
end
|
142
|
+
|
143
|
+
def scm_plugin_installed?
|
144
|
+
installer.scm_installed?
|
135
145
|
end
|
136
146
|
|
137
147
|
def servers
|
@@ -18,16 +18,34 @@ module Capistrano
|
|
18
18
|
# install(Capistrano::SCM::Git)
|
19
19
|
# install(Capistrano::SCM::Git.new)
|
20
20
|
#
|
21
|
-
|
21
|
+
# Note that the :load_immediately flag is for internal use only and will
|
22
|
+
# be removed in an upcoming release.
|
23
|
+
#
|
24
|
+
def install(plugin, load_hooks: true, load_immediately: false)
|
22
25
|
plugin = plugin.is_a?(Class) ? plugin.new : plugin
|
23
26
|
|
24
27
|
plugin.define_tasks
|
25
28
|
plugin.register_hooks if load_hooks
|
29
|
+
@scm_installed ||= provides_scm?(plugin)
|
26
30
|
|
27
|
-
|
31
|
+
if load_immediately
|
28
32
|
plugin.set_defaults
|
33
|
+
else
|
34
|
+
Rake::Task.define_task("load:defaults") do
|
35
|
+
plugin.set_defaults
|
36
|
+
end
|
29
37
|
end
|
30
38
|
end
|
39
|
+
|
40
|
+
def scm_installed?
|
41
|
+
@scm_installed
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def provides_scm?(plugin)
|
47
|
+
plugin.respond_to?(:scm?) && plugin.scm?
|
48
|
+
end
|
31
49
|
end
|
32
50
|
end
|
33
51
|
end
|
@@ -0,0 +1,144 @@
|
|
1
|
+
module Capistrano
|
2
|
+
class Configuration
|
3
|
+
# In earlier versions of Capistrano, users would specify the desired SCM
|
4
|
+
# implementation using `set :scm, :git`, for example. Capistrano would then
|
5
|
+
# load the matching .rb file based on this variable.
|
6
|
+
#
|
7
|
+
# Now we expect users to explicitly `require` and call `new` on the desired
|
8
|
+
# SCM implementation in their Capfile. The `set` technique is deprecated.
|
9
|
+
#
|
10
|
+
# This SCMResolver class takes care of managing the transition from the old
|
11
|
+
# to new system. It maintains the legacy behavior, but prints deprecation
|
12
|
+
# warnings when it is used.
|
13
|
+
#
|
14
|
+
# To maintain backwards compatibility, the resolver will load the Git SCM by
|
15
|
+
# if default it determines that no SCM has been explicitly specified or
|
16
|
+
# loaded. To force no SCM to be used at all, use `set :scm, nil`. This hack
|
17
|
+
# won't be necessary once backwards compatibility is removed in a future
|
18
|
+
# version.
|
19
|
+
#
|
20
|
+
# TODO: Remove this class entirely in Capistrano 4.0.
|
21
|
+
#
|
22
|
+
class SCMResolver
|
23
|
+
DEFAULT_GIT = :"default-git"
|
24
|
+
|
25
|
+
include Capistrano::DSL
|
26
|
+
|
27
|
+
def resolve
|
28
|
+
return if scm_name.nil?
|
29
|
+
set(:scm, :git) if using_default_scm?
|
30
|
+
|
31
|
+
print_deprecation_warnings_if_applicable
|
32
|
+
# Note that `scm_plugin_installed?` comes from Capistrano::DSL
|
33
|
+
return if scm_plugin_installed?
|
34
|
+
|
35
|
+
if built_in_scm_name?
|
36
|
+
load_built_in_scm
|
37
|
+
else
|
38
|
+
# Compatibility with existing 3.x third-party SCMs
|
39
|
+
register_legacy_scm_hooks
|
40
|
+
load_legacy_scm_by_name
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def using_default_scm?
|
47
|
+
return @using_default_scm if defined? @using_default_scm
|
48
|
+
@using_default_scm = (fetch(:scm) == DEFAULT_GIT)
|
49
|
+
end
|
50
|
+
|
51
|
+
def scm_name
|
52
|
+
fetch(:scm)
|
53
|
+
end
|
54
|
+
|
55
|
+
def load_built_in_scm
|
56
|
+
require "capistrano/scm/#{scm_name}"
|
57
|
+
scm_class = Object.const_get(built_in_scm_plugin_class_name)
|
58
|
+
# We use :load_immediately because we are initializing the SCM plugin
|
59
|
+
# late in the load process and therefore can't use the standard
|
60
|
+
# load:defaults technique.
|
61
|
+
install_plugin(scm_class, load_immediately: true)
|
62
|
+
end
|
63
|
+
|
64
|
+
def load_legacy_scm_by_name
|
65
|
+
load("capistrano/#{scm_name}.rb")
|
66
|
+
end
|
67
|
+
|
68
|
+
def third_party_scm_name?
|
69
|
+
!built_in_scm_name?
|
70
|
+
end
|
71
|
+
|
72
|
+
def built_in_scm_name?
|
73
|
+
%w(git hg svn).include?(scm_name.to_s.downcase)
|
74
|
+
end
|
75
|
+
|
76
|
+
def built_in_scm_plugin_class_name
|
77
|
+
"Capistrano::SCM::#{scm_name.to_s.capitalize}"
|
78
|
+
end
|
79
|
+
|
80
|
+
# rubocop:disable Style/GuardClause
|
81
|
+
def register_legacy_scm_hooks
|
82
|
+
if Rake::Task.task_defined?("deploy:new_release_path")
|
83
|
+
after "deploy:new_release_path", "#{scm_name}:create_release"
|
84
|
+
end
|
85
|
+
|
86
|
+
if Rake::Task.task_defined?("deploy:check")
|
87
|
+
before "deploy:check", "#{scm_name}:check"
|
88
|
+
end
|
89
|
+
|
90
|
+
if Rake::Task.task_defined?("deploy:set_current_revision")
|
91
|
+
before "deploy:set_current_revision",
|
92
|
+
"#{scm_name}:set_current_revision"
|
93
|
+
end
|
94
|
+
end
|
95
|
+
# rubocop:enable Style/GuardClause
|
96
|
+
|
97
|
+
def print_deprecation_warnings_if_applicable
|
98
|
+
if using_default_scm?
|
99
|
+
warn_add_git_to_capfile unless scm_plugin_installed?
|
100
|
+
elsif built_in_scm_name?
|
101
|
+
warn_set_scm_is_deprecated
|
102
|
+
elsif third_party_scm_name?
|
103
|
+
warn_third_party_scm_must_be_upgraded
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def warn_set_scm_is_deprecated
|
108
|
+
$stderr.puts(<<-MESSAGE)
|
109
|
+
[Deprecation Notice] `set :scm, #{scm_name.inspect}` is deprecated.
|
110
|
+
To ensure your project is compatible with future versions of Capistrano,
|
111
|
+
remove the :scm setting and instead add these lines to your Capfile:
|
112
|
+
|
113
|
+
require "capistrano/scm/#{scm_name}"
|
114
|
+
install_plugin #{built_in_scm_plugin_class_name}
|
115
|
+
|
116
|
+
MESSAGE
|
117
|
+
end
|
118
|
+
|
119
|
+
def warn_add_git_to_capfile
|
120
|
+
$stderr.puts(<<-MESSAGE)
|
121
|
+
[Deprecation Notice] Future versions of Capistrano will not load the Git SCM
|
122
|
+
plugin by default. To silence this deprecation warning, add the following to
|
123
|
+
your Capfile:
|
124
|
+
|
125
|
+
require "capistrano/scm/git"
|
126
|
+
install_plugin Capistrano::SCM::Git
|
127
|
+
|
128
|
+
MESSAGE
|
129
|
+
end
|
130
|
+
|
131
|
+
def warn_third_party_scm_must_be_upgraded
|
132
|
+
$stderr.puts(<<-MESSAGE)
|
133
|
+
[Deprecation Notice] `set :scm, #{scm_name.inspect}` is deprecated.
|
134
|
+
To ensure this custom SCM will work with future versions of Capistrano,
|
135
|
+
please upgrade it to a version that uses the new SCM plugin mechanism
|
136
|
+
documented here:
|
137
|
+
|
138
|
+
http://capistranorb.com/documentation/advanced-features/custom-scm
|
139
|
+
|
140
|
+
MESSAGE
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|