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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0bf003b9169b22ddd324533323c2ccd5a3873aec
4
- data.tar.gz: 5fd9c7d79004cbc67c515903f280b74f80bd3c87
3
+ metadata.gz: 35f2b78fb4e59fac89010f9b933316eaf4d2242c
4
+ data.tar.gz: 1e41412f1e55f7e0d94e84acb198b96a29d5d054
5
5
  SHA512:
6
- metadata.gz: a89eca74965d39609a504a1032356e66a762847d69ff6a45951585a3e1002f3575ab0a9837dc545fe7536f8b38297f83ad93e894ac454bda219e07b847c9797c
7
- data.tar.gz: 2b0fa5af27a608a391476c31d57640e875b97408e503b279bca9fd0bf05b83aa54ab0dad693f51f29ede1261ed77ba76206d55189810f6d27ee3a62c1792228f
6
+ metadata.gz: 2786a1cf32881d164cc3836ec986a6e42acb19b8367bec59fa1c6250eb9b82e5e2ccee69f428edfe838f81b894ed96811ea3bcd02c41ca93f50536705596cfe3
7
+ data.tar.gz: d166e4c962b78ff8c06e93876283bde101286bc8964ac5b39fcd76f8717273c0b7d90786a5abb909cd96cc0b50ab1d71c1624d1abd3a277945e01a27bca299b2
@@ -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:
@@ -10,17 +10,29 @@ gem "capistrano", :github => "capistrano/capistrano"
10
10
 
11
11
  ## master
12
12
 
13
- https://github.com/capistrano/capistrano/compare/v3.7.2...HEAD
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
- ### Potentially breaking changes:
33
+ ### Minor breaking changes:
22
34
 
23
- * [#1846](https://github.com/capistrano/capistrano/pull/1846): add_host will add a new host in a case where it used to incorrectly update an existing one (potentially breaking) [(@dbenamy)](https://github.com/dbenamy)
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
@@ -3,7 +3,7 @@ require "cucumber/rake/task"
3
3
  require "rspec/core/rake_task"
4
4
  require "rubocop/rake_task"
5
5
 
6
- task default: [:spec, :rubocop]
6
+ task default: %i(spec rubocop)
7
7
  RSpec::Core::RakeTask.new
8
8
 
9
9
  Cucumber::Rake::Task.new(:features)
@@ -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 with the default configuration
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 "install"
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 "install STAGES=qa,production"
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
@@ -2,6 +2,10 @@ Given(/^a test app with the default configuration$/) do
2
2
  TestApp.install
3
3
  end
4
4
 
5
+ Given(/^a test app without any configuration$/) do
6
+ TestApp.create_test_app
7
+ end
8
+
5
9
  Given(/^servers with the roles app and web$/) do
6
10
  begin
7
11
  vagrant_cli_command("up")
@@ -96,7 +96,7 @@ module Capistrano
96
96
  end
97
97
 
98
98
  def load_imports
99
- if options.show_tasks
99
+ if options.show_tasks && Rake::Task.task_defined?("load:defaults")
100
100
  invoke "load:defaults"
101
101
  set(:stage, "")
102
102
  Dir[deploy_config_path].each { |f| add_import f }
@@ -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 [:host, :role].include? type
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
@@ -8,7 +8,7 @@ validate :application do |_key, value|
8
8
  end
9
9
  end
10
10
 
11
- [:git_strategy, :hg_strategy, :svn_strategy].each do |strategy|
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 = [:application, :repo_url, :repo_tree].freeze
10
+ WHITELIST = %i(application repo_url repo_tree).freeze
11
11
  private_constant :WHITELIST
12
12
 
13
13
  include Capistrano::Doctor::OutputHelpers
@@ -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 = [:application, :stage, :local_user].map { |key| fetch(key).to_s }.join("-")
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 {
@@ -1,3 +1,3 @@
1
1
  module Capistrano
2
- VERSION = "3.8.0".freeze
2
+ VERSION = "3.8.1".freeze
3
3
  end
@@ -5,7 +5,7 @@ module Capistrano
5
5
  describe Filter do
6
6
  let(:available) do
7
7
  [
8
- Server.new("server1").add_roles([:web, :db]),
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([:web, :db]),
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) { [:web, :db] }
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
 
@@ -13,7 +13,7 @@ module Capistrano
13
13
  end
14
14
 
15
15
  describe "adding roles" do
16
- subject { server.add_roles([:things, :stuff]) }
16
+ subject { server.add_roles(%i(things stuff)) }
17
17
  it "adds the roles" do
18
18
  expect { subject }.to change { server.roles.size }.from(0).to(2)
19
19
  end
@@ -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([:web, :app]) }
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([:app, :web]).map(&:hostname)).to eq %w{1 2 3}
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) { [:app, :web] }
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) { [:app, :web] }
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 [:key1, :key2]
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) { Hash.new }
258
+ let(:options) { {} }
259
259
 
260
260
  before do
261
261
  Configuration::Question.expects(:new).with(:branch, :default, options)
@@ -44,14 +44,14 @@ module TestApp
44
44
  end
45
45
 
46
46
  Dir.chdir(test_app_path) do
47
- `bundle`
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
- `bundle exec cap install STAGES=#{stage}`
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 "bundle exec cap #{stage} #{task}", subdirectory
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.0
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-03-10 00:00:00.000000000 Z
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: '0'
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: '0'
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.10
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