capistrano 3.7.1 → 3.7.2

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: c06ca713a10918695c9a37ae1cb67c3cc567e6bc
4
- data.tar.gz: 99aac73258a129add7dd88eabcc6d96740d796f0
3
+ metadata.gz: a9e2c0975c618c32c327228eb811012535f44223
4
+ data.tar.gz: 545d241645e8487733e8edb9d163ef92fa738e93
5
5
  SHA512:
6
- metadata.gz: b21deea03c5a2b813e4e6fd078db5c43edf0e1482d94b46038a6e12e8a998bf5bd10e8460fdb438fa30405339b005674ef436516008a97acf7804125e8bf6886
7
- data.tar.gz: a53999efd7cf1c188fe18b707ae01dff70dd2c30b39dff44a5b92a61177cfb0c1c82b2c000c4e98e5cf46f574ed594923fefb40caa379f82fcf9f3126f497a37
6
+ metadata.gz: d92ccd5bb651b77426b30e5acffe766178882a3dc97e0dfca0bbeed55a6e9fc9fd3d47d1e8c35fcee20fc62ec46d0815b09f5a7107fed4767859b465ce50ef83
7
+ data.tar.gz: a588aea0a342852d0f9836aeb1d10ea87485650743671343d59878b4291cd014f1bea122600583933377bdf0444be43d271fa302803109be5cc41d1a7bbbc1da
@@ -3,6 +3,10 @@ AllCops:
3
3
  DisplayStyleGuide: true
4
4
  TargetRubyVersion: 2.0
5
5
 
6
+ Metrics/BlockLength:
7
+ Exclude:
8
+ - "spec/**/*"
9
+ - "lib/**/*.rake"
6
10
  Style/BarePercentLiterals:
7
11
  EnforcedStyle: percent_q
8
12
  Style/ClassAndModuleChildren:
@@ -4,10 +4,23 @@ Reverse Chronological Order:
4
4
 
5
5
  ## master
6
6
 
7
- https://github.com/capistrano/capistrano/compare/v3.7.1...HEAD
7
+ https://github.com/capistrano/capistrano/compare/v3.7.2...HEAD
8
8
 
9
9
  * Your contribution here!
10
10
 
11
+ ## `3.7.2` (2017-01-27)
12
+
13
+ https://github.com/capistrano/capistrano/compare/v3.7.1...v3.7.2
14
+
15
+ ### Potentially breaking changes:
16
+
17
+ * None
18
+
19
+ ### Other changes:
20
+
21
+ * Suppress log messages of `git ls-remote` by filtering remote refs (@aeroastro)
22
+ * The Git SCM now allows the repo_url to be changed without manually wiping out the mirror on each target host first (@javanthropus)
23
+
11
24
  ## `3.7.1` (2016-12-16)
12
25
 
13
26
  https://github.com/capistrano/capistrano/compare/v3.7.0...v3.7.1
@@ -12,7 +12,7 @@ set :scm, :svn
12
12
  To avoid deprecation warnings:
13
13
 
14
14
  1. Remove `set :scm, ...` from your Capistrano configuration.
15
- 2. Add *one* of the following SCM declarations to your `Capfile`:
15
+ 2. Add *one* of the following SCM declarations to your `Capfile` after `require "capistrano/deploy"`:
16
16
 
17
17
  ```ruby
18
18
  # To use Git
@@ -7,7 +7,6 @@ Feature: Deploy
7
7
  Scenario: Creating the repo
8
8
  When I run cap "git:check"
9
9
  Then the task is successful
10
- And references in the remote repo are listed
11
10
  And git wrapper permissions are 0700
12
11
 
13
12
  Scenario: Creating the directory structure
@@ -17,10 +17,12 @@ module Capistrano
17
17
  end
18
18
  end
19
19
 
20
+ # rubocop:disable Security/MarshalLoad
20
21
  def add_role(role, hosts, options={})
21
22
  options_deepcopy = Marshal.dump(options.merge(roles: role))
22
23
  Array(hosts).each { |host| add_host(host, Marshal.load(options_deepcopy)) }
23
24
  end
25
+ # rubocop:enable Security/MarshalLoad
24
26
 
25
27
  def roles_for(names)
26
28
  options = extract_options(names)
@@ -35,7 +35,7 @@ module Capistrano
35
35
  end
36
36
 
37
37
  def set(key, value=nil, &block)
38
- @trusted_keys << key if trusted?
38
+ @trusted_keys << key if trusted? && !@trusted_keys.include?(key)
39
39
  remember_location(key)
40
40
  values[key] = block || value
41
41
  trace_set(key)
@@ -43,7 +43,7 @@ module Capistrano
43
43
  end
44
44
 
45
45
  def fetch(key, default=nil, &block)
46
- fetched_keys << key
46
+ fetched_keys << key unless fetched_keys.include?(key)
47
47
  peek(key, default, &block)
48
48
  end
49
49
 
@@ -59,10 +59,12 @@ module Capistrano
59
59
  VersionValidator.new(locked_version).verify
60
60
  end
61
61
 
62
+ # rubocop:disable Security/MarshalLoad
62
63
  def on(hosts, options={}, &block)
63
64
  subset_copy = Marshal.dump(Configuration.env.filter(hosts))
64
65
  SSHKit::Coordinator.new(Marshal.load(subset_copy)).each(options, &block)
65
66
  end
67
+ # rubocop:enable Security/MarshalLoad
66
68
 
67
69
  def run_locally(&block)
68
70
  SSHKit::Backend::Local.new(&block).run
@@ -32,7 +32,7 @@ class Capistrano::SCM::Git < Capistrano::SCM::Plugin
32
32
  end
33
33
 
34
34
  def check_repo_is_reachable
35
- git :'ls-remote --heads', repo_url
35
+ git :'ls-remote', repo_url, "HEAD"
36
36
  end
37
37
 
38
38
  def clone_repo
@@ -44,6 +44,9 @@ class Capistrano::SCM::Git < Capistrano::SCM::Plugin
44
44
  end
45
45
 
46
46
  def update_mirror
47
+ # Update the origin URL if necessary.
48
+ git :remote, "set-url", "origin", repo_url
49
+
47
50
  # Note: Requires git version 1.9 or greater
48
51
  if (depth = fetch(:git_shallow_clone))
49
52
  git :fetch, "--depth", depth, "origin", fetch(:branch)
@@ -1,3 +1,3 @@
1
1
  module Capistrano
2
- VERSION = "3.7.1".freeze
2
+ VERSION = "3.7.2".freeze
3
3
  end
@@ -46,7 +46,7 @@ module Capistrano
46
46
  describe "#check_repo_is_reachable" do
47
47
  it "should test the repo url" do
48
48
  env.set(:repo_url, "url")
49
- backend.expects(:execute).with(:git, :'ls-remote --heads', "url").returns(true)
49
+ backend.expects(:execute).with(:git, :'ls-remote', "url", "HEAD").returns(true)
50
50
 
51
51
  subject.check_repo_is_reachable
52
52
  end
@@ -74,6 +74,9 @@ module Capistrano
74
74
 
75
75
  describe "#update_mirror" do
76
76
  it "should run git update" do
77
+ env.set(:repo_url, "url")
78
+
79
+ backend.expects(:execute).with(:git, :remote, "set-url", "origin", "url")
77
80
  backend.expects(:execute).with(:git, :remote, :update, "--prune")
78
81
 
79
82
  subject.update_mirror
@@ -82,6 +85,9 @@ module Capistrano
82
85
  it "should run git update in shallow mode" do
83
86
  env.set(:git_shallow_clone, "1")
84
87
  env.set(:branch, "branch")
88
+ env.set(:repo_url, "url")
89
+
90
+ backend.expects(:execute).with(:git, :remote, "set-url", "origin", "url")
85
91
  backend.expects(:execute).with(:git, :fetch, "--depth", "1", "origin", "branch")
86
92
 
87
93
  subject.update_mirror
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.1
4
+ version: 3.7.2
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-16 00:00:00.000000000 Z
12
+ date: 2017-01-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: airbrussh
@@ -297,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
297
  version: '0'
298
298
  requirements: []
299
299
  rubyforge_project:
300
- rubygems_version: 2.6.8
300
+ rubygems_version: 2.6.10
301
301
  signing_key:
302
302
  specification_version: 4
303
303
  summary: Capistrano - Welcome to easy deployment with Ruby over SSH