capistrano 3.7.0 → 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: ce22b5f5826e88b5fd92b3369c02344f20e2191e
4
- data.tar.gz: 491397aab719879777bec4153c3125575f86e62a
3
+ metadata.gz: a9e2c0975c618c32c327228eb811012535f44223
4
+ data.tar.gz: 545d241645e8487733e8edb9d163ef92fa738e93
5
5
  SHA512:
6
- metadata.gz: 37864d78dd2d14478f0e9edcb316ac5e68fe5dc83b02bfd4017b1790350b26d1c929f6b94890fe351101fd05257f4bf8ce427fb8f5be0d1758e36e48fcc70fd5
7
- data.tar.gz: 6eec3f49c1e4867137d3d266d533c44bcba2bc076d1e8d003e51bcc8735a14f613ef8c49a86f69417cd40deca95b2827115885289113e490ea8bf0940639c50b
6
+ metadata.gz: d92ccd5bb651b77426b30e5acffe766178882a3dc97e0dfca0bbeed55a6e9fc9fd3d47d1e8c35fcee20fc62ec46d0815b09f5a7107fed4767859b465ce50ef83
7
+ data.tar.gz: a588aea0a342852d0f9836aeb1d10ea87485650743671343d59878b4291cd014f1bea122600583933377bdf0444be43d271fa302803109be5cc41d1a7bbbc1da
data/.rubocop.yml CHANGED
@@ -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:
data/CHANGELOG.md CHANGED
@@ -4,10 +4,35 @@ Reverse Chronological Order:
4
4
 
5
5
  ## master
6
6
 
7
- https://github.com/capistrano/capistrano/compare/v3.7.0...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
+
24
+ ## `3.7.1` (2016-12-16)
25
+
26
+ https://github.com/capistrano/capistrano/compare/v3.7.0...v3.7.1
27
+
28
+ ### Potentially breaking changes:
29
+
30
+ * None
31
+
32
+ ### Fixes:
33
+
34
+ * Fixed a bug with mercurial deploys failing due to an undefined variable
35
+
11
36
  ## `3.7.0` (2016-12-10)
12
37
 
13
38
  https://github.com/capistrano/capistrano/compare/v3.6.1...v3.7.0
data/UPGRADING-3.7.md CHANGED
@@ -1,16 +1,5 @@
1
1
  # Capistrano 3.7.0 upgrade guide
2
2
 
3
- Capistrano 3.7.0 has not yet been released. This guide serves as a preview of
4
- what is *planned* for 3.7.0, so that you can be prepared to update your
5
- Capistrano deployment if necessary once it becomes available.
6
-
7
- If you wish to try the new 3.7.0 behavior today, you can do so by using the
8
- `master` branch in your Gemfile:
9
-
10
- ```ruby
11
- gem "capistrano", :github => "capistrano/capistrano"
12
- ```
13
-
14
3
  ## The :scm variable is deprecated
15
4
 
16
5
  Up until now, Capistrano's SCM was configured using the `:scm` variable:
@@ -23,7 +12,7 @@ set :scm, :svn
23
12
  To avoid deprecation warnings:
24
13
 
25
14
  1. Remove `set :scm, ...` from your Capistrano configuration.
26
- 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"`:
27
16
 
28
17
  ```ruby
29
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)
@@ -28,7 +28,7 @@ namespace :hg do
28
28
  task update: :'hg:clone' do
29
29
  on release_roles :all do
30
30
  within repo_path do
31
- hr.update_mirror
31
+ hg_plugin.update_mirror
32
32
  end
33
33
  end
34
34
  end
@@ -1,3 +1,3 @@
1
1
  module Capistrano
2
- VERSION = "3.7.0".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.0
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-10 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