chef-cli 3.0.4 → 3.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +8 -3
- data/chef-cli.gemspec +2 -3
- data/lib/chef-cli/cli.rb +7 -1
- data/lib/chef-cli/command/generator_commands/chef_exts/generator_desc_resource.rb +1 -0
- data/lib/chef-cli/command/update.rb +1 -1
- data/lib/chef-cli/cookbook_profiler/git.rb +1 -1
- data/lib/chef-cli/policyfile/chef_server_lock_fetcher.rb +1 -1
- data/lib/chef-cli/policyfile/cookbook_locks.rb +2 -2
- data/lib/chef-cli/policyfile/delivery_supermarket_source.rb +1 -1
- data/lib/chef-cli/policyfile/local_lock_fetcher.rb +1 -1
- data/lib/chef-cli/policyfile/policyfile_location_specification.rb +1 -1
- data/lib/chef-cli/policyfile/read_cookbook_for_compat_mode_upload.rb +2 -2
- data/lib/chef-cli/policyfile_compiler.rb +1 -1
- data/lib/chef-cli/policyfile_lock.rb +1 -2
- data/lib/chef-cli/skeletons/code_generator/files/default/chefignore +13 -7
- data/lib/chef-cli/skeletons/code_generator/metadata.rb +1 -1
- data/lib/chef-cli/skeletons/code_generator/templates/default/build_cookbook/metadata.rb.erb +1 -1
- data/lib/chef-cli/skeletons/code_generator/templates/default/metadata.rb.erb +1 -1
- data/lib/chef-cli/version.rb +1 -1
- data/lib/kitchen/provisioner/chef_zero_capture.rb +3 -4
- data/lib/kitchen/provisioner/policyfile_zero.rb +1 -2
- data/spec/unit/command/clean_policy_cookbooks_spec.rb +2 -2
- data/spec/unit/command/env_spec.rb +1 -1
- data/spec/unit/command/exec_spec.rb +1 -1
- data/spec/unit/command/generator_commands/build_cookbook_spec.rb +1 -1
- data/spec/unit/commands_map_spec.rb +4 -4
- data/spec/unit/kitchen/provisioner/chef_zero_capture_spec.rb +0 -1
- data/spec/unit/policyfile_includes_spec.rb +0 -1
- data/spec/unit/policyfile_install_with_includes_spec.rb +0 -1
- data/spec/unit/policyfile_lock_build_spec.rb +0 -1
- metadata +11 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32790ab3b088b47eecb22d5be42cb45915584d117687f6133f689fa7ae40b9b4
|
4
|
+
data.tar.gz: 3225502afa9009b0fb4d7cec8d0e1c5a2de851c8bcc982ef26a985e1e6e2aed1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79d8e068694829682f02159f01ab4aeb38930ce9a1f967fb90dc89958a0870c0ad4b804f1a75da6dcc36174dafae0d18569ca3a20cb4448a1f55db23bc83baee
|
7
|
+
data.tar.gz: 7a708060fc06c798514384e6ac4f8367a138d0d37aae8cda9ccb5cecabff6c0a953880801f808e12774b6210c18d3c4dde761fe98b5a8a7c18a4d07f8b8864bb
|
data/Gemfile
CHANGED
@@ -13,13 +13,18 @@ group :test do
|
|
13
13
|
gem "rspec", "~> 3.8"
|
14
14
|
gem "rspec-expectations", "~> 3.8"
|
15
15
|
gem "rspec-mocks", "~> 3.8"
|
16
|
-
gem "cookstyle"
|
17
|
-
gem "chefstyle"
|
16
|
+
gem "cookstyle", "6.13.3" # this forces dependabot PRs to open which triggers cookstyle CI on the chef generate command
|
17
|
+
gem "chefstyle", "1.2.0"
|
18
|
+
gem "test-kitchen", "> 2.5"
|
19
|
+
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.6")
|
20
|
+
gem "chef-zero", "~> 14"
|
21
|
+
gem "chef", "~> 15"
|
22
|
+
end
|
18
23
|
end
|
19
24
|
|
20
25
|
group :development do
|
21
26
|
gem "pry"
|
22
27
|
gem "pry-byebug"
|
23
|
-
gem "pry-stack_explorer"
|
28
|
+
gem "pry-stack_explorer", "~> 0.4.0"
|
24
29
|
gem "rb-readline"
|
25
30
|
end
|
data/chef-cli.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |gem|
|
|
29
29
|
gem.license = "Apache-2.0"
|
30
30
|
gem.homepage = "https://www.chef.io/"
|
31
31
|
|
32
|
-
gem.required_ruby_version = ">= 2.
|
32
|
+
gem.required_ruby_version = ">= 2.5"
|
33
33
|
|
34
34
|
gem.files = %w{Rakefile LICENSE} +
|
35
35
|
Dir.glob("Gemfile*") + # Includes Gemfile and locks
|
@@ -47,8 +47,7 @@ Gem::Specification.new do |gem|
|
|
47
47
|
gem.add_dependency "solve", "< 5.0", "> 2.0"
|
48
48
|
gem.add_dependency "addressable", ">= 2.3.5", "< 2.8"
|
49
49
|
gem.add_dependency "cookbook-omnifetch", "~> 0.5"
|
50
|
-
gem.add_dependency "diff-lcs", "
|
50
|
+
gem.add_dependency "diff-lcs", ">= 1.0", "< 1.4" # 1.4 changes the output
|
51
51
|
gem.add_dependency "paint", ">= 1", "< 3"
|
52
52
|
gem.add_dependency "license-acceptance", "~> 1.0", ">= 1.0.11"
|
53
|
-
gem.add_development_dependency "test-kitchen", "> 2.5"
|
54
53
|
end
|
data/lib/chef-cli/cli.rb
CHANGED
@@ -122,7 +122,13 @@ module ChefCLI
|
|
122
122
|
"Test Kitchen": "kitchen",
|
123
123
|
"Cookstyle": "cookstyle",
|
124
124
|
}.each do |name, cli|
|
125
|
-
|
125
|
+
# @todo when Ruby 2.5/2.6 support goes away this if statement can go away
|
126
|
+
if Gem::Version.new(Bundler::VERSION) >= Gem::Version.new("2")
|
127
|
+
result = Bundler.with_unbundled_env { shell_out("#{cli} --version") }
|
128
|
+
else
|
129
|
+
result = Bundler.with_clean_env { shell_out("#{cli} --version") }
|
130
|
+
end
|
131
|
+
|
126
132
|
if result.exitstatus != 0
|
127
133
|
msg("#{name} version: ERROR")
|
128
134
|
else
|
@@ -70,7 +70,7 @@ module ChefCLI
|
|
70
70
|
|
71
71
|
option :exclude_deps,
|
72
72
|
long: "--exclude-deps",
|
73
|
-
description: "Only update cookbooks
|
73
|
+
description: "Only update cookbooks explicitly mentioned on the command line",
|
74
74
|
boolean: true,
|
75
75
|
default: false
|
76
76
|
|
@@ -31,7 +31,7 @@ module ChefCLI
|
|
31
31
|
@unborn_branch_ref = nil
|
32
32
|
end
|
33
33
|
|
34
|
-
# @return [Hash] Hashed used for pinning cookbook versions within a
|
34
|
+
# @return [Hash] Hashed used for pinning cookbook versions within a Policyfile.lock
|
35
35
|
def profile_data
|
36
36
|
{
|
37
37
|
"scm" => "git",
|
@@ -400,8 +400,8 @@ module ChefCLI
|
|
400
400
|
|
401
401
|
dot_git = Pathname.new(".git")
|
402
402
|
Pathname.new(cookbook_path).ascend do |parent_dir|
|
403
|
-
|
404
|
-
if
|
403
|
+
possible_git_dir = parent_dir + dot_git
|
404
|
+
if possible_git_dir.exist?
|
405
405
|
@cookbook_in_git_repo = true
|
406
406
|
break
|
407
407
|
end
|
@@ -39,7 +39,7 @@ module ChefCLI
|
|
39
39
|
# * Version numbers for cookbooks that pass through the Ci pipeline always
|
40
40
|
# increase over time (so that largest version number == newest)
|
41
41
|
#
|
42
|
-
# In the future, alternative approaches may be
|
42
|
+
# In the future, alternative approaches may be pursued to achieve the goal
|
43
43
|
# of continuously integrating at the cookbook level without imposing those
|
44
44
|
# constraints.
|
45
45
|
#
|
@@ -89,9 +89,9 @@ module ChefCLI
|
|
89
89
|
@cookbook_version ||=
|
90
90
|
begin
|
91
91
|
cookbook_version = loader.cookbook_version
|
92
|
-
# TODO:
|
92
|
+
# TODO: don't do this for non-compat mode
|
93
93
|
cookbook_version.version = version_override
|
94
|
-
# TODO:
|
94
|
+
# TODO: don't do this either
|
95
95
|
|
96
96
|
# Fixup manifest.
|
97
97
|
# What happens is, the 'manifest' representation of cookbook
|
@@ -274,7 +274,7 @@ module ChefCLI
|
|
274
274
|
# compared to an unmodified copy upstream. For example, the community site
|
275
275
|
# may have a cookbook "apache2" at version "1.10.4", which the user has
|
276
276
|
# forked on github and modified the dependencies without changing the
|
277
|
-
# version number. To
|
277
|
+
# version number. To accommodate this, the local_artifacts_graph should be
|
278
278
|
# merged over the upstream's artifacts graph.
|
279
279
|
def local_artifacts_graph
|
280
280
|
cookbook_location_specs.inject({}) do |local_artifacts, (cookbook_name, cookbook_location_spec)|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# -*- coding: UTF-8 -*-
|
2
1
|
#
|
3
2
|
# Copyright:: Copyright (c) 2014-2018 Chef Software Inc.
|
4
3
|
# License:: Apache License, Version 2.0
|
@@ -362,7 +361,7 @@ module ChefCLI
|
|
362
361
|
# doubles give 15-17 digits of precision, so we err on the safe side
|
363
362
|
# and only use 15 digits in the string conversion. We use the `g`
|
364
363
|
# format, which is a documented-enough "do what I mean" where floats
|
365
|
-
# >= 0.1 and <
|
364
|
+
# >= 0.1 and < precision are represented as floating point literals, and
|
366
365
|
# other numbers use the exponent notation with a lowercase 'e'. Note
|
367
366
|
# that both Ruby and Erlang document what their `g` does but have some
|
368
367
|
# differences both subtle and non-subtle:
|
@@ -9,10 +9,7 @@ ehthumbs.db
|
|
9
9
|
Icon?
|
10
10
|
nohup.out
|
11
11
|
Thumbs.db
|
12
|
-
|
13
|
-
# SASS #
|
14
|
-
########
|
15
|
-
.sass-cache
|
12
|
+
.envrc
|
16
13
|
|
17
14
|
# EDITORS #
|
18
15
|
###########
|
@@ -26,11 +23,11 @@ Thumbs.db
|
|
26
23
|
*.tmproj
|
27
24
|
*~
|
28
25
|
\#*
|
29
|
-
mkmf.log
|
30
26
|
REVISION
|
31
27
|
TAGS*
|
32
28
|
tmtags
|
33
29
|
.vscode
|
30
|
+
.editorconfig
|
34
31
|
|
35
32
|
## COMPILED ##
|
36
33
|
##############
|
@@ -43,22 +40,29 @@ tmtags
|
|
43
40
|
*.so
|
44
41
|
*/rdoc/
|
45
42
|
a.out
|
43
|
+
mkmf.log
|
46
44
|
|
47
45
|
# Testing #
|
48
46
|
###########
|
49
47
|
.circleci/*
|
50
48
|
.codeclimate.yml
|
49
|
+
.delivery/*
|
51
50
|
.foodcritic
|
52
51
|
.kitchen*
|
52
|
+
.mdlrc
|
53
|
+
.overcommit.yml
|
53
54
|
.rspec
|
54
55
|
.rubocop.yml
|
55
56
|
.travis.yml
|
56
57
|
.watchr
|
58
|
+
.yamllint
|
57
59
|
azure-pipelines.yml
|
60
|
+
Dangerfile
|
58
61
|
examples/*
|
59
62
|
features/*
|
60
63
|
Guardfile
|
61
64
|
kitchen.yml*
|
65
|
+
mlc_config.json
|
62
66
|
Procfile
|
63
67
|
Rakefile
|
64
68
|
spec/*
|
@@ -71,6 +75,7 @@ test/*
|
|
71
75
|
.gitconfig
|
72
76
|
.github/*
|
73
77
|
.gitignore
|
78
|
+
.gitkeep
|
74
79
|
.gitmodules
|
75
80
|
.svn
|
76
81
|
*/.bzr/*
|
@@ -98,10 +103,11 @@ Policyfile.lock.json
|
|
98
103
|
|
99
104
|
# Documentation #
|
100
105
|
#############
|
101
|
-
|
106
|
+
CODE_OF_CONDUCT*
|
102
107
|
CONTRIBUTING*
|
108
|
+
documentation/*
|
103
109
|
TESTING*
|
104
|
-
|
110
|
+
UPGRADING*
|
105
111
|
|
106
112
|
# Vagrant #
|
107
113
|
###########
|
@@ -4,7 +4,7 @@ maintainer_email '<%= email %>'
|
|
4
4
|
license '<%= @spdx_license %>'
|
5
5
|
description 'Installs/Configures <%= cookbook_name %>'
|
6
6
|
version '0.1.0'
|
7
|
-
chef_version '>=
|
7
|
+
chef_version '>= 15.0'
|
8
8
|
|
9
9
|
# The `issues_url` points to the location where issues for this cookbook are
|
10
10
|
# tracked. A `View Issues` link will be displayed on this cookbook's page when
|
data/lib/chef-cli/version.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
1
|
#
|
3
2
|
# Author:: Marc Paradise <marc@chef.io>
|
4
3
|
#
|
@@ -45,7 +44,7 @@ module Kitchen
|
|
45
44
|
#
|
46
45
|
# This provisioner does not do any cookbook dependency
|
47
46
|
# resolution and will not pull in external cookbooks. All cookbooks
|
48
|
-
# or cookbook
|
47
|
+
# or cookbook artifacts + policy data as captured from the live node and are
|
49
48
|
# expected to be available for chef-zero to provide to the client.
|
50
49
|
class ChefZeroCapture < ChefZero
|
51
50
|
# Declaring these ensure that they're available to the sandbox - it's initialized
|
@@ -55,7 +54,7 @@ module Kitchen
|
|
55
54
|
default_config :cookbook_artifacts_path, "cookbook_artifacts"
|
56
55
|
|
57
56
|
# This will load policyfile/berkshelf. We don't want either - the client resolves all
|
58
|
-
# dependencies from chef-zero, exactly as
|
57
|
+
# dependencies from chef-zero, exactly as prepped in the captured repository.
|
59
58
|
def load_needed_dependencies!; end
|
60
59
|
|
61
60
|
def create_sandbox
|
@@ -73,7 +72,7 @@ module Kitchen
|
|
73
72
|
end
|
74
73
|
|
75
74
|
# Overriding the private ProviderChefZero#default_config_rb
|
76
|
-
# so that we can add additional
|
75
|
+
# so that we can add additional configuration required for chef-zero
|
77
76
|
# to be able to locate our policies/, policy groups, and cookbook artifacts
|
78
77
|
# at run-time.
|
79
78
|
def default_config_rb
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
1
|
#
|
3
2
|
# Author:: Fletcher Nichol (<fnichol@nichol.ca>)
|
4
3
|
#
|
@@ -54,7 +53,7 @@ module Kitchen
|
|
54
53
|
# @author Daniel DeLeo <dan@chef.io>
|
55
54
|
class PolicyfileZero < ChefBase
|
56
55
|
|
57
|
-
# This
|
56
|
+
# This provisioner will forcibly set the following config options:
|
58
57
|
# * `use_policyfile`: `true`
|
59
58
|
# * `versioned_cookbooks`: `true`
|
60
59
|
# * `deployment_group`: `POLICY_NAME-local`
|
@@ -50,9 +50,9 @@ describe ChefCLI::Command::CleanPolicyCookbooks do
|
|
50
50
|
|
51
51
|
context "when given a path to the config" do
|
52
52
|
|
53
|
-
let(:params) { %w{ -c ~/
|
53
|
+
let(:params) { %w{ -c ~/other_stuff/config.rb } }
|
54
54
|
|
55
|
-
let(:config_arg) { "~/
|
55
|
+
let(:config_arg) { "~/other_stuff/config.rb" }
|
56
56
|
|
57
57
|
before do
|
58
58
|
expect(chef_config_loader).to receive(:load)
|
@@ -69,7 +69,7 @@ describe ChefCLI::Command::Env do
|
|
69
69
|
it "output should be valid yaml" do
|
70
70
|
expect { yaml }.not_to raise_error
|
71
71
|
end
|
72
|
-
it "Workstation version should indicate that that we're not
|
72
|
+
it "Workstation version should indicate that that we're not running from a WS install" do
|
73
73
|
expect(yaml).to have_key ChefCLI::Dist::PRODUCT
|
74
74
|
expect(yaml[ChefCLI::Dist::PRODUCT]["Version"]).to eql "Not running from within Workstation"
|
75
75
|
end
|
@@ -59,7 +59,7 @@ describe ChefCLI::Command::Exec do
|
|
59
59
|
before do
|
60
60
|
allow(Gem).to receive(:ruby).and_return(ruby_path)
|
61
61
|
|
62
|
-
# Using a fake path separator to keep to prevent people from
|
62
|
+
# Using a fake path separator to keep to prevent people from accidentally
|
63
63
|
# getting things correct on their system. This enforces that, in general,
|
64
64
|
# you should use the path separator ruby is telling you to use.
|
65
65
|
stub_const("File::PATH_SEPARATOR", "<>")
|
@@ -25,7 +25,7 @@ describe ChefCLI::CommandsMap do
|
|
25
25
|
|
26
26
|
before do
|
27
27
|
mapping.builtin("example", :Example)
|
28
|
-
mapping.builtin("
|
28
|
+
mapping.builtin("hyphenated-example", :HyphenatedExample)
|
29
29
|
mapping.builtin("explicit-path-example", :ExplicitPathExample, require_path: "unit/fixtures/command/explicit_path_example")
|
30
30
|
mapping.builtin("documented-example", :DocumentedExample, desc: "I have documentation")
|
31
31
|
end
|
@@ -34,16 +34,16 @@ describe ChefCLI::CommandsMap do
|
|
34
34
|
expect(mapping.have_command?("example")).to be true
|
35
35
|
end
|
36
36
|
|
37
|
-
it "infers a non-
|
37
|
+
it "infers a non-hyphenated command's require path" do
|
38
38
|
expect(mapping.spec_for("example").require_path).to eq("chef-cli/command/example")
|
39
39
|
end
|
40
40
|
|
41
41
|
it "infers a hyphenated command's require path" do
|
42
|
-
expect(mapping.spec_for("
|
42
|
+
expect(mapping.spec_for("hyphenated-example").require_path).to eq("chef-cli/command/hyphenated_example")
|
43
43
|
end
|
44
44
|
|
45
45
|
it "lists the available commands" do
|
46
|
-
expect(mapping.command_names).to match_array(%w{example
|
46
|
+
expect(mapping.command_names).to match_array(%w{example hyphenated-example explicit-path-example documented-example})
|
47
47
|
end
|
48
48
|
|
49
49
|
it "keeps the docstring of a command" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-cli
|
@@ -156,16 +156,22 @@ dependencies:
|
|
156
156
|
name: diff-lcs
|
157
157
|
requirement: !ruby/object:Gem::Requirement
|
158
158
|
requirements:
|
159
|
-
- - "
|
159
|
+
- - ">="
|
160
160
|
- !ruby/object:Gem::Version
|
161
161
|
version: '1.0'
|
162
|
+
- - "<"
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: '1.4'
|
162
165
|
type: :runtime
|
163
166
|
prerelease: false
|
164
167
|
version_requirements: !ruby/object:Gem::Requirement
|
165
168
|
requirements:
|
166
|
-
- - "
|
169
|
+
- - ">="
|
167
170
|
- !ruby/object:Gem::Version
|
168
171
|
version: '1.0'
|
172
|
+
- - "<"
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: '1.4'
|
169
175
|
- !ruby/object:Gem::Dependency
|
170
176
|
name: paint
|
171
177
|
requirement: !ruby/object:Gem::Requirement
|
@@ -206,20 +212,6 @@ dependencies:
|
|
206
212
|
- - ">="
|
207
213
|
- !ruby/object:Gem::Version
|
208
214
|
version: 1.0.11
|
209
|
-
- !ruby/object:Gem::Dependency
|
210
|
-
name: test-kitchen
|
211
|
-
requirement: !ruby/object:Gem::Requirement
|
212
|
-
requirements:
|
213
|
-
- - ">"
|
214
|
-
- !ruby/object:Gem::Version
|
215
|
-
version: '2.5'
|
216
|
-
type: :development
|
217
|
-
prerelease: false
|
218
|
-
version_requirements: !ruby/object:Gem::Requirement
|
219
|
-
requirements:
|
220
|
-
- - ">"
|
221
|
-
- !ruby/object:Gem::Version
|
222
|
-
version: '2.5'
|
223
215
|
description: A streamlined development and deployment workflow for Chef platform.
|
224
216
|
email:
|
225
217
|
- info@chef.io
|
@@ -608,7 +600,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
608
600
|
requirements:
|
609
601
|
- - ">="
|
610
602
|
- !ruby/object:Gem::Version
|
611
|
-
version: '2.
|
603
|
+
version: '2.5'
|
612
604
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
613
605
|
requirements:
|
614
606
|
- - ">="
|