berkshelf 7.2.2 → 8.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/berkshelf.gemspec +6 -1
- data/lib/berkshelf/berksfile.rb +2 -2
- data/lib/berkshelf/location.rb +1 -1
- data/lib/berkshelf/locations/github.rb +1 -1
- data/lib/berkshelf/packager.rb +38 -2
- data/lib/berkshelf/thor_ext/hash_with_indifferent_access.rb +1 -1
- data/lib/berkshelf/version.rb +1 -1
- data/spec/config/knife.rb +1 -1
- data/spec/support/git.rb +1 -1
- data/spec/unit/berkshelf/dependency_spec.rb +1 -1
- data/spec/unit/berkshelf/location_spec.rb +1 -1
- metadata +11 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eca450739cdb53861e1a527e0147f702b71c898bac6d3ab317fa53f8b7150dc2
|
4
|
+
data.tar.gz: 625a9e32681e15e4d553c9d56653cb16396255c347fcc45f1e9a51e61fc41324
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2079eaf58a614ed63b85335a02fe19bd8ae8083856341905a95c83ba4eca1185744e5164c683d8610f0b2bbb332bd5636a1814daaf7c37a149d76b979be7ccf7
|
7
|
+
data.tar.gz: 7fd481876fab292339aac18016d5727bbe197186c3e92e6093dfebba962fc7540b0141b55fce6235263db945fc7423b0e138094d3fbe85a68d041a713268977d
|
data/Gemfile
CHANGED
@@ -7,7 +7,6 @@ group :build do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
group :development do
|
10
|
-
gem "chef-bin" # for the proxy tests
|
11
10
|
gem "aruba", "~> 0.10" # Stay below 1 until aruba/in_process monkeypatching stops
|
12
11
|
gem "cucumber", "< 4.0" # until we identify what is generating the ~@no_run tag in CI
|
13
12
|
gem "cucumber-expressions", "= 5.0.13"
|
data/berkshelf.gemspec
CHANGED
@@ -25,8 +25,13 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.name = "berkshelf"
|
26
26
|
s.require_paths = ["lib"]
|
27
27
|
s.version = Berkshelf::VERSION
|
28
|
-
s.required_ruby_version = ">= 2.
|
28
|
+
s.required_ruby_version = ">= 2.7.0"
|
29
29
|
s.required_rubygems_version = ">= 2.0.0"
|
30
|
+
s.metadata = {
|
31
|
+
"bug_tracker_uri" => "https://github.com/chef/berkshelf/issues",
|
32
|
+
"source_code_uri" => "https://github.com/chef/berkshelf",
|
33
|
+
"changelog_uri" => "https://github.com/chef/berkshelf/blob/main/CHANGELOG.md",
|
34
|
+
}
|
30
35
|
|
31
36
|
s.add_dependency "mixlib-shellout", ">= 2.0", "< 4.0"
|
32
37
|
s.add_dependency "cleanroom", "~> 1.0"
|
data/lib/berkshelf/berksfile.rb
CHANGED
@@ -118,7 +118,7 @@ module Berkshelf
|
|
118
118
|
# cookbook 'artifact', path: '/Users/reset/code/artifact'
|
119
119
|
#
|
120
120
|
# @example a cookbook dependency that will be retrieved from a Git server
|
121
|
-
# cookbook 'artifact', git: '
|
121
|
+
# cookbook 'artifact', git: 'https://github.com/chef/artifact-cookbook.git'
|
122
122
|
#
|
123
123
|
# @overload cookbook(name, version_constraint, options = {})
|
124
124
|
# @param [#to_s] name
|
@@ -156,7 +156,7 @@ module Berkshelf
|
|
156
156
|
options[:group] += @active_group
|
157
157
|
end
|
158
158
|
|
159
|
-
add_dependency(name, constraint, options)
|
159
|
+
add_dependency(name, constraint, **options)
|
160
160
|
end
|
161
161
|
expose :cookbook
|
162
162
|
|
data/lib/berkshelf/location.rb
CHANGED
@@ -9,7 +9,7 @@ module Berkshelf
|
|
9
9
|
# is returned.
|
10
10
|
#
|
11
11
|
# @example Create a git location
|
12
|
-
# Location.init(dependency, git: '
|
12
|
+
# Location.init(dependency, git: 'https://github.com/berkshelf/berkshelf.git')
|
13
13
|
#
|
14
14
|
# @example Create a GitHub location
|
15
15
|
# Location.init(dependency, github: 'berkshelf/berkshelf')
|
@@ -9,7 +9,7 @@ module Berkshelf
|
|
9
9
|
when :https
|
10
10
|
options[:git] = "https://#{HOST}/#{options.delete(:github)}.git"
|
11
11
|
when :git
|
12
|
-
options[:git] = "
|
12
|
+
options[:git] = "https://#{HOST}/#{options.delete(:github)}.git"
|
13
13
|
else
|
14
14
|
# if some bizarre value is provided, treat it as :https
|
15
15
|
options[:git] = "https://#{HOST}/#{options.delete(:github)}.git"
|
data/lib/berkshelf/packager.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "archive/tar/minitar"
|
2
|
+
require "find" unless defined?(Find)
|
2
3
|
require "zlib" unless defined?(Zlib)
|
3
4
|
|
4
5
|
module Berkshelf
|
@@ -40,8 +41,18 @@ module Berkshelf
|
|
40
41
|
# @return [String]
|
41
42
|
# path to the generated archive
|
42
43
|
def run(source)
|
43
|
-
|
44
|
-
|
44
|
+
begin
|
45
|
+
dest = Zlib::GzipWriter.open(out_file)
|
46
|
+
tar = RelativeTarWriter.new(dest, source)
|
47
|
+
Find.find(source) do |entry|
|
48
|
+
next if source == entry
|
49
|
+
|
50
|
+
Archive::Tar::Minitar.pack_file(entry, tar)
|
51
|
+
end
|
52
|
+
ensure
|
53
|
+
tar.close
|
54
|
+
dest.close
|
55
|
+
end
|
45
56
|
|
46
57
|
out_file
|
47
58
|
rescue SystemCallError => ex
|
@@ -67,5 +78,30 @@ module Berkshelf
|
|
67
78
|
|
68
79
|
# @return [String]
|
69
80
|
attr_reader :filename
|
81
|
+
|
82
|
+
# A private decorator for Archive::Tar::Minitar::Writer that
|
83
|
+
# turns absolute paths into relative ones.
|
84
|
+
class RelativeTarWriter < SimpleDelegator # :nodoc:
|
85
|
+
def initialize(io, base_path)
|
86
|
+
@base_path = Pathname.new(base_path)
|
87
|
+
super(Archive::Tar::Minitar::Writer.new(io))
|
88
|
+
end
|
89
|
+
|
90
|
+
%w{add_file add_file_simple mkdir}.each do |method|
|
91
|
+
class_eval <<~RUBY
|
92
|
+
def #{method}(name, *opts, &block)
|
93
|
+
super(relative_path(name), *opts, &block)
|
94
|
+
end
|
95
|
+
RUBY
|
96
|
+
end
|
97
|
+
|
98
|
+
private
|
99
|
+
|
100
|
+
attr_reader :base_path
|
101
|
+
|
102
|
+
def relative_path(path)
|
103
|
+
Pathname.new(path).relative_path_from(base_path).to_s
|
104
|
+
end
|
105
|
+
end
|
70
106
|
end
|
71
107
|
end
|
data/lib/berkshelf/version.rb
CHANGED
data/spec/config/knife.rb
CHANGED
@@ -4,7 +4,7 @@ node_name "berkshelf"
|
|
4
4
|
client_key File.expand_path("spec/config/berkshelf.pem")
|
5
5
|
validation_client_name "validator"
|
6
6
|
validation_key File.expand_path("spec/config/validator.pem")
|
7
|
-
chef_server_url "http://
|
7
|
+
chef_server_url "http://127.0.0.1:26310"
|
8
8
|
cache_type "BasicFile"
|
9
9
|
cache_options( path: "#{ENV["HOME"]}/.chef/checksums" )
|
10
10
|
cookbook_path []
|
data/spec/support/git.rb
CHANGED
@@ -5,7 +5,7 @@ module Berkshelf
|
|
5
5
|
include Berkshelf::RSpec::PathHelpers
|
6
6
|
|
7
7
|
def git_origin_for(repo, options = {})
|
8
|
-
"file://#{generate_fake_git_remote("git@github.com/
|
8
|
+
"file://#{generate_fake_git_remote("git@github.com/chef/#{repo}.git", options)}/.git"
|
9
9
|
end
|
10
10
|
|
11
11
|
def generate_fake_git_remote(uri, options = {})
|
@@ -35,7 +35,7 @@ describe Berkshelf::Dependency do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
context "given a location key :git" do
|
38
|
-
let(:url) { "
|
38
|
+
let(:url) { "https://url_to_git" }
|
39
39
|
let(:source) { described_class.new(berksfile, cookbook_name, git: url) }
|
40
40
|
|
41
41
|
it "initializes a GitLocation for location" do
|
@@ -11,7 +11,7 @@ module Berkshelf
|
|
11
11
|
end
|
12
12
|
|
13
13
|
it "finds a :git location by key" do
|
14
|
-
instance = described_class.init(dependency, git: "
|
14
|
+
instance = described_class.init(dependency, git: "https://foo.com/meats/bacon.git")
|
15
15
|
expect(instance).to be_a(GitLocation)
|
16
16
|
end
|
17
17
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: berkshelf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 8.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamie Winsor
|
@@ -9,10 +9,10 @@ authors:
|
|
9
9
|
- Michael Ivey
|
10
10
|
- Justin Campbell
|
11
11
|
- Seth Vargo
|
12
|
-
autorequire:
|
12
|
+
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2022-06-02 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: mixlib-shellout
|
@@ -359,8 +359,11 @@ files:
|
|
359
359
|
homepage: https://docs.chef.io/berkshelf.html
|
360
360
|
licenses:
|
361
361
|
- Apache-2.0
|
362
|
-
metadata:
|
363
|
-
|
362
|
+
metadata:
|
363
|
+
bug_tracker_uri: https://github.com/chef/berkshelf/issues
|
364
|
+
source_code_uri: https://github.com/chef/berkshelf
|
365
|
+
changelog_uri: https://github.com/chef/berkshelf/blob/main/CHANGELOG.md
|
366
|
+
post_install_message:
|
364
367
|
rdoc_options: []
|
365
368
|
require_paths:
|
366
369
|
- lib
|
@@ -368,15 +371,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
368
371
|
requirements:
|
369
372
|
- - ">="
|
370
373
|
- !ruby/object:Gem::Version
|
371
|
-
version: 2.
|
374
|
+
version: 2.7.0
|
372
375
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
373
376
|
requirements:
|
374
377
|
- - ">="
|
375
378
|
- !ruby/object:Gem::Version
|
376
379
|
version: 2.0.0
|
377
380
|
requirements: []
|
378
|
-
rubygems_version: 3.2.
|
379
|
-
signing_key:
|
381
|
+
rubygems_version: 3.2.32
|
382
|
+
signing_key:
|
380
383
|
specification_version: 4
|
381
384
|
summary: Manages a Chef cookbook's dependencies
|
382
385
|
test_files: []
|