capistrano 3.8.0 → 3.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +8 -0
- data/CHANGELOG.md +15 -3
- data/Rakefile +1 -1
- data/capistrano.gemspec +2 -1
- data/features/installation.feature +8 -3
- data/features/step_definitions/setup.rb +4 -0
- data/lib/capistrano/application.rb +1 -1
- data/lib/capistrano/configuration/filter.rb +1 -1
- data/lib/capistrano/defaults.rb +1 -1
- data/lib/capistrano/doctor/variables_doctor.rb +1 -1
- data/lib/capistrano/scm/git.rb +1 -1
- data/lib/capistrano/version.rb +1 -1
- data/spec/lib/capistrano/configuration/filter_spec.rb +1 -1
- data/spec/lib/capistrano/configuration/role_filter_spec.rb +2 -2
- data/spec/lib/capistrano/configuration/server_spec.rb +1 -1
- data/spec/lib/capistrano/configuration/servers_spec.rb +4 -4
- data/spec/lib/capistrano/configuration_spec.rb +2 -2
- data/spec/support/test_app.rb +10 -4
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35f2b78fb4e59fac89010f9b933316eaf4d2242c
|
4
|
+
data.tar.gz: 1e41412f1e55f7e0d94e84acb198b96a29d5d054
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2786a1cf32881d164cc3836ec986a6e42acb19b8367bec59fa1c6250eb9b82e5e2ccee69f428edfe838f81b894ed96811ea3bcd02c41ca93f50536705596cfe3
|
7
|
+
data.tar.gz: d166e4c962b78ff8c06e93876283bde101286bc8964ac5b39fcd76f8717273c0b7d90786a5abb909cd96cc0b50ab1d71c1624d1abd3a277945e01a27bca299b2
|
data/.rubocop.yml
CHANGED
@@ -3,6 +3,9 @@ AllCops:
|
|
3
3
|
DisplayStyleGuide: true
|
4
4
|
TargetRubyVersion: 2.0
|
5
5
|
|
6
|
+
Lint/AmbiguousBlockAssociation:
|
7
|
+
Enabled:
|
8
|
+
false
|
6
9
|
Metrics/BlockLength:
|
7
10
|
Exclude:
|
8
11
|
- "spec/**/*"
|
@@ -13,6 +16,11 @@ Style/ClassAndModuleChildren:
|
|
13
16
|
Enabled: false
|
14
17
|
Style/DoubleNegation:
|
15
18
|
Enabled: false
|
19
|
+
Style/FileName:
|
20
|
+
Exclude:
|
21
|
+
- "Dangerfile"
|
22
|
+
Style/IndentHeredoc:
|
23
|
+
Enabled: false
|
16
24
|
Style/SpaceAroundEqualsInParameterDefault:
|
17
25
|
EnforcedStyle: no_space
|
18
26
|
Style/StringLiterals:
|
data/CHANGELOG.md
CHANGED
@@ -10,17 +10,29 @@ gem "capistrano", :github => "capistrano/capistrano"
|
|
10
10
|
|
11
11
|
## master
|
12
12
|
|
13
|
-
https://github.com/capistrano/capistrano/compare/v3.
|
13
|
+
https://github.com/capistrano/capistrano/compare/v3.8.1...HEAD
|
14
14
|
|
15
15
|
* Your contribution here!
|
16
16
|
|
17
|
+
## `3.8.1` (2017-04-21)
|
18
|
+
|
19
|
+
https://github.com/capistrano/capistrano/compare/v3.8.0...v3.8.1
|
20
|
+
|
21
|
+
### Breaking changes:
|
22
|
+
|
23
|
+
* None
|
24
|
+
|
25
|
+
### Fixes:
|
26
|
+
|
27
|
+
* [#1867](https://github.com/capistrano/capistrano/pull/1867): Allow `cap -T` to run without Capfile present - [@mattbrictson](https://github.com/mattbrictson)
|
28
|
+
|
17
29
|
## `3.8.0` (2017-03-10)
|
18
30
|
|
19
31
|
https://github.com/capistrano/capistrano/compare/v3.7.2...v3.8.0
|
20
32
|
|
21
|
-
###
|
33
|
+
### Minor breaking changes:
|
22
34
|
|
23
|
-
* [#1846](https://github.com/capistrano/capistrano/pull/1846): add_host
|
35
|
+
* [#1846](https://github.com/capistrano/capistrano/pull/1846): add_host - When this method has already been called once for a given host and it is called a second time with a port, a new host will be added. Previously, the first host would have been updated. [(@dbenamy)](https://github.com/dbenamy)
|
24
36
|
|
25
37
|
### New features:
|
26
38
|
|
data/Rakefile
CHANGED
data/capistrano.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
|
2
3
|
lib = File.expand_path("../lib", __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require "capistrano/version"
|
@@ -28,5 +29,5 @@ Gem::Specification.new do |gem|
|
|
28
29
|
gem.add_development_dependency "danger"
|
29
30
|
gem.add_development_dependency "mocha"
|
30
31
|
gem.add_development_dependency "rspec"
|
31
|
-
gem.add_development_dependency "rubocop"
|
32
|
+
gem.add_development_dependency "rubocop", "0.48.1"
|
32
33
|
end
|
@@ -1,16 +1,21 @@
|
|
1
1
|
Feature: Installation
|
2
2
|
|
3
3
|
Background:
|
4
|
-
Given a test app
|
4
|
+
Given a test app without any configuration
|
5
|
+
|
6
|
+
Scenario: The "install" task documentation can be viewed
|
7
|
+
When I run "cap -T"
|
8
|
+
Then the task is successful
|
9
|
+
And contains "cap install" in the output
|
5
10
|
|
6
11
|
Scenario: With default stages
|
7
|
-
When I run cap
|
12
|
+
When I run "cap install"
|
8
13
|
Then the deploy.rb file is created
|
9
14
|
And the default stage files are created
|
10
15
|
And the tasks folder is created
|
11
16
|
|
12
17
|
Scenario: With specified stages
|
13
|
-
When I run cap
|
18
|
+
When I run "cap install STAGES=qa,production"
|
14
19
|
Then the deploy.rb file is created
|
15
20
|
And the specified stage files are created
|
16
21
|
And the tasks folder is created
|
@@ -8,7 +8,7 @@ module Capistrano
|
|
8
8
|
class Configuration
|
9
9
|
class Filter
|
10
10
|
def initialize(type, values=nil)
|
11
|
-
raise "Invalid filter type #{type}" unless
|
11
|
+
raise "Invalid filter type #{type}" unless %i(host role).include? type
|
12
12
|
av = Array(values)
|
13
13
|
@strategy = if av.empty? then EmptyFilter.new
|
14
14
|
elsif av.include?(:all) || av.include?("all") then NullFilter.new
|
data/lib/capistrano/defaults.rb
CHANGED
@@ -8,7 +8,7 @@ validate :application do |_key, value|
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
|
11
|
+
%i(git_strategy hg_strategy svn_strategy).each do |strategy|
|
12
12
|
validate(strategy) do |key, _value|
|
13
13
|
warn(
|
14
14
|
"[Deprecation Warning] #{key} is deprecated and will be removed in "\
|
@@ -7,7 +7,7 @@ module Capistrano
|
|
7
7
|
class VariablesDoctor
|
8
8
|
# These are keys that have no default values in Capistrano, but are
|
9
9
|
# nonetheless expected to be set.
|
10
|
-
WHITELIST =
|
10
|
+
WHITELIST = %i(application repo_url repo_tree).freeze
|
11
11
|
private_constant :WHITELIST
|
12
12
|
|
13
13
|
include Capistrano::Doctor::OutputHelpers
|
data/lib/capistrano/scm/git.rb
CHANGED
@@ -9,7 +9,7 @@ class Capistrano::SCM::Git < Capistrano::SCM::Plugin
|
|
9
9
|
set_if_empty :git_wrapper_path, lambda {
|
10
10
|
# Try to avoid permissions issues when multiple users deploy the same app
|
11
11
|
# by using different file names in the same dir for each deployer and stage.
|
12
|
-
suffix =
|
12
|
+
suffix = %i(application stage local_user).map { |key| fetch(key).to_s }.join("-")
|
13
13
|
"#{fetch(:tmp_dir)}/git-ssh-#{suffix}.sh"
|
14
14
|
}
|
15
15
|
set_if_empty :git_environmental_variables, lambda {
|
data/lib/capistrano/version.rb
CHANGED
@@ -5,7 +5,7 @@ module Capistrano
|
|
5
5
|
describe Filter do
|
6
6
|
let(:available) do
|
7
7
|
[
|
8
|
-
Server.new("server1").add_roles(
|
8
|
+
Server.new("server1").add_roles(%i(web db)),
|
9
9
|
Server.new("server2").add_role(:web),
|
10
10
|
Server.new("server3").add_role(:redis),
|
11
11
|
Server.new("server4").add_role(:db),
|
@@ -7,7 +7,7 @@ module Capistrano
|
|
7
7
|
|
8
8
|
let(:available) do
|
9
9
|
[
|
10
|
-
Server.new("server1").add_roles(
|
10
|
+
Server.new("server1").add_roles(%i(web db)),
|
11
11
|
Server.new("server2").add_role(:web),
|
12
12
|
Server.new("server3").add_role(:redis),
|
13
13
|
Server.new("server4").add_role(:db),
|
@@ -41,7 +41,7 @@ module Capistrano
|
|
41
41
|
end
|
42
42
|
|
43
43
|
context "with multiple roles" do
|
44
|
-
let(:values) {
|
44
|
+
let(:values) { %i(web db) }
|
45
45
|
it_behaves_like "it filters roles correctly", 3, %w{server1 server2 server4}
|
46
46
|
end
|
47
47
|
|
@@ -56,7 +56,7 @@ module Capistrano
|
|
56
56
|
|
57
57
|
describe "collecting server roles" do
|
58
58
|
let(:app) { Set.new([:app]) }
|
59
|
-
let(:web_app) { Set.new(
|
59
|
+
let(:web_app) { Set.new(%i(web app)) }
|
60
60
|
let(:web) { Set.new([:web]) }
|
61
61
|
|
62
62
|
before do
|
@@ -108,7 +108,7 @@ module Capistrano
|
|
108
108
|
end
|
109
109
|
|
110
110
|
it "returns the correct app and web servers" do
|
111
|
-
expect(servers.roles_for(
|
111
|
+
expect(servers.roles_for(%i(app web)).map(&:hostname)).to eq %w{1 2 3}
|
112
112
|
end
|
113
113
|
|
114
114
|
it "returns all servers" do
|
@@ -284,7 +284,7 @@ module Capistrano
|
|
284
284
|
end
|
285
285
|
|
286
286
|
context "when selecting specific roles" do
|
287
|
-
let(:roles) {
|
287
|
+
let(:roles) { %i(app web) }
|
288
288
|
it "ignores it" do
|
289
289
|
expect(subject).to eq %w{1 2 3 4}
|
290
290
|
end
|
@@ -312,7 +312,7 @@ module Capistrano
|
|
312
312
|
end
|
313
313
|
|
314
314
|
context "when selecting specific roles" do
|
315
|
-
let(:roles) {
|
315
|
+
let(:roles) { %i(app web) }
|
316
316
|
it "ignores it" do
|
317
317
|
expect(subject).to eq %w{1 2 3 4}
|
318
318
|
end
|
@@ -238,7 +238,7 @@ module Capistrano
|
|
238
238
|
end
|
239
239
|
|
240
240
|
it "returns all set keys" do
|
241
|
-
expect(subject).to match_array
|
241
|
+
expect(subject).to match_array %i(key1 key2)
|
242
242
|
end
|
243
243
|
end
|
244
244
|
|
@@ -255,7 +255,7 @@ module Capistrano
|
|
255
255
|
|
256
256
|
describe "asking" do
|
257
257
|
let(:question) { stub }
|
258
|
-
let(:options) {
|
258
|
+
let(:options) { {} }
|
259
259
|
|
260
260
|
before do
|
261
261
|
Configuration::Question.expects(:new).with(:branch, :default, options)
|
data/spec/support/test_app.rb
CHANGED
@@ -44,14 +44,14 @@ module TestApp
|
|
44
44
|
end
|
45
45
|
|
46
46
|
Dir.chdir(test_app_path) do
|
47
|
-
|
47
|
+
run "bundle"
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
51
|
def install_test_app_with(config)
|
52
52
|
create_test_app
|
53
53
|
Dir.chdir(test_app_path) do
|
54
|
-
|
54
|
+
run "cap install STAGES=#{stage}"
|
55
55
|
end
|
56
56
|
write_local_deploy_file(config)
|
57
57
|
end
|
@@ -91,14 +91,15 @@ module TestApp
|
|
91
91
|
end
|
92
92
|
|
93
93
|
def cap(task, subdirectory=nil)
|
94
|
-
run "
|
94
|
+
run "cap #{stage} #{task} --trace", subdirectory
|
95
95
|
end
|
96
96
|
|
97
97
|
def run(command, subdirectory=nil)
|
98
98
|
output = nil
|
99
|
+
command = "bundle exec #{command}" unless command =~ /^bundle\b/
|
99
100
|
dir = subdirectory ? test_app_path.join(subdirectory) : test_app_path
|
100
101
|
Dir.chdir(dir) do
|
101
|
-
output = `#{command}`
|
102
|
+
output = with_clean_bundler_env { `#{command}` }
|
102
103
|
end
|
103
104
|
[$CHILD_STATUS.success?, output]
|
104
105
|
end
|
@@ -187,4 +188,9 @@ module TestApp
|
|
187
188
|
def git_wrapper_path
|
188
189
|
"/tmp/git-ssh-my_app_name-#{stage}-#{current_user}.sh"
|
189
190
|
end
|
191
|
+
|
192
|
+
def with_clean_bundler_env(&block)
|
193
|
+
return yield unless defined?(Bundler)
|
194
|
+
Bundler.with_clean_env(&block)
|
195
|
+
end
|
190
196
|
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.8.
|
4
|
+
version: 3.8.1
|
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: 2017-
|
12
|
+
date: 2017-04-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: airbrussh
|
@@ -113,16 +113,16 @@ dependencies:
|
|
113
113
|
name: rubocop
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
|
-
- -
|
116
|
+
- - '='
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version:
|
118
|
+
version: 0.48.1
|
119
119
|
type: :development
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
|
-
- -
|
123
|
+
- - '='
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version:
|
125
|
+
version: 0.48.1
|
126
126
|
description: Capistrano is a utility and framework for executing commands in parallel
|
127
127
|
on multiple remote machines, via SSH.
|
128
128
|
email:
|
@@ -285,7 +285,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
285
285
|
version: '0'
|
286
286
|
requirements: []
|
287
287
|
rubyforge_project:
|
288
|
-
rubygems_version: 2.6.
|
288
|
+
rubygems_version: 2.6.11
|
289
289
|
signing_key:
|
290
290
|
specification_version: 4
|
291
291
|
summary: Capistrano - Welcome to easy deployment with Ruby over SSH
|