chef-cli 1.0.14 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -11
  3. data/Rakefile +0 -16
  4. data/bin/{chef → chef-cli} +0 -0
  5. data/chef-cli.gemspec +7 -6
  6. data/lib/chef-cli/cli.rb +6 -6
  7. data/lib/chef-cli/command/clean_policy_cookbooks.rb +1 -1
  8. data/lib/chef-cli/command/clean_policy_revisions.rb +1 -1
  9. data/lib/chef-cli/command/delete_policy.rb +1 -1
  10. data/lib/chef-cli/command/delete_policy_group.rb +1 -1
  11. data/lib/chef-cli/command/describe_cookbook.rb +1 -1
  12. data/lib/chef-cli/command/export.rb +1 -1
  13. data/lib/chef-cli/command/generator_commands/cookbook.rb +1 -1
  14. data/lib/chef-cli/command/generator_commands/generator_generator.rb +0 -1
  15. data/lib/chef-cli/command/generator_commands/policyfile.rb +2 -2
  16. data/lib/chef-cli/command/install.rb +2 -2
  17. data/lib/chef-cli/command/push.rb +1 -1
  18. data/lib/chef-cli/command/push_archive.rb +1 -1
  19. data/lib/chef-cli/command/show_policy.rb +1 -1
  20. data/lib/chef-cli/command/undelete.rb +1 -1
  21. data/lib/chef-cli/command/update.rb +1 -1
  22. data/lib/chef-cli/dist.rb +8 -0
  23. data/lib/chef-cli/generator.rb +1 -1
  24. data/lib/chef-cli/helpers.rb +2 -2
  25. data/lib/chef-cli/policyfile/cookbook_location_specification.rb +2 -1
  26. data/lib/chef-cli/policyfile/lock_fetcher_mixin.rb +2 -2
  27. data/lib/chef-cli/policyfile/uploader.rb +2 -2
  28. data/lib/chef-cli/policyfile_services/export_repo.rb +5 -0
  29. data/lib/chef-cli/policyfile_services/install.rb +2 -0
  30. data/lib/chef-cli/policyfile_services/rm_policy.rb +1 -1
  31. data/lib/chef-cli/policyfile_services/update_attributes.rb +2 -0
  32. data/lib/chef-cli/skeletons/code_generator/files/default/build_cookbook/README.md +3 -3
  33. data/lib/chef-cli/skeletons/code_generator/files/default/build_cookbook/kitchen.yml +2 -2
  34. data/lib/chef-cli/skeletons/code_generator/files/default/chefignore +2 -3
  35. data/lib/chef-cli/skeletons/code_generator/files/default/cookbook_readmes/README-policy.md +1 -1
  36. data/lib/chef-cli/skeletons/code_generator/files/default/cookbook_readmes/README.md +2 -2
  37. data/lib/chef-cli/skeletons/code_generator/files/default/delivery-project.toml +3 -5
  38. data/lib/chef-cli/skeletons/code_generator/files/default/repo/README.md +1 -1
  39. data/lib/chef-cli/skeletons/code_generator/files/default/repo/cookbooks/example/README.md +2 -2
  40. data/lib/chef-cli/skeletons/code_generator/files/default/repo/cookbooks/example/attributes/default.rb +1 -1
  41. data/lib/chef-cli/skeletons/code_generator/files/default/repo/cookbooks/example/recipes/default.rb +1 -1
  42. data/lib/chef-cli/skeletons/code_generator/files/default/repo/data_bags/README.md +4 -4
  43. data/lib/chef-cli/skeletons/code_generator/files/default/repo/environments/README.md +2 -2
  44. data/lib/chef-cli/skeletons/code_generator/files/default/repo/roles/README.md +2 -2
  45. data/lib/chef-cli/skeletons/code_generator/metadata.rb +2 -3
  46. data/lib/chef-cli/skeletons/code_generator/recipes/build_cookbook.rb +2 -2
  47. data/lib/chef-cli/skeletons/code_generator/recipes/cookbook.rb +1 -1
  48. data/lib/chef-cli/skeletons/code_generator/recipes/repo.rb +1 -1
  49. data/lib/chef-cli/skeletons/code_generator/templates/default/CHANGELOG.md.erb +1 -2
  50. data/lib/chef-cli/skeletons/code_generator/templates/default/Policyfile.rb.erb +1 -1
  51. data/lib/chef-cli/skeletons/code_generator/templates/default/helpers.rb.erb +2 -2
  52. data/lib/chef-cli/skeletons/code_generator/templates/default/kitchen.yml.erb +4 -4
  53. data/lib/chef-cli/skeletons/code_generator/templates/default/kitchen_dokken.yml.erb +4 -4
  54. data/lib/chef-cli/skeletons/code_generator/templates/default/kitchen_policyfile.yml.erb +4 -4
  55. data/lib/chef-cli/skeletons/code_generator/templates/default/metadata.rb.erb +0 -1
  56. data/lib/chef-cli/skeletons/code_generator/templates/default/recipe_spec.rb.erb +4 -4
  57. data/lib/chef-cli/skeletons/code_generator/templates/default/resource.rb.erb +1 -1
  58. data/lib/chef-cli/version.rb +1 -1
  59. data/lib/kitchen/provisioner/chef_zero_capture.rb +90 -0
  60. data/spec/unit/command/generator_commands/cookbook_spec.rb +15 -17
  61. data/spec/unit/command/generator_commands/generator_generator_spec.rb +0 -1
  62. data/spec/unit/command/generator_commands/policyfile_spec.rb +1 -1
  63. data/spec/unit/command/generator_commands/repo_spec.rb +5 -5
  64. data/spec/unit/kitchen/provisioner/chef_zero_capture_spec.rb +84 -0
  65. data/spec/unit/policyfile/cookbook_location_specification_spec.rb +5 -0
  66. data/spec/unit/policyfile/uploader_spec.rb +2 -2
  67. data/spec/unit/policyfile_lock_build_spec.rb +1 -1
  68. data/spec/unit/policyfile_services/clean_policies_spec.rb +2 -0
  69. data/spec/unit/policyfile_services/update_attributes_spec.rb +1 -1
  70. data/spec/unit/service_exception_inspectors/http_spec.rb +1 -1
  71. metadata +36 -13
@@ -11,8 +11,8 @@ provisioner:
11
11
  product_name: chefdk
12
12
 
13
13
  platforms:
14
- - name: ubuntu-18.04
15
- - name: centos-7
14
+ - name: ubuntu-20.04
15
+ - name: centos-8
16
16
 
17
17
  suites:
18
18
  - name: default
@@ -30,6 +30,7 @@ mkmf.log
30
30
  REVISION
31
31
  TAGS*
32
32
  tmtags
33
+ .vscode
33
34
 
34
35
  ## COMPILED ##
35
36
  ##############
@@ -61,8 +62,6 @@ kitchen.yml*
61
62
  Procfile
62
63
  Rakefile
63
64
  spec/*
64
- spec/*
65
- spec/fixtures/*
66
65
  test/*
67
66
 
68
67
  # SCM #
@@ -97,7 +96,7 @@ Gemfile.lock
97
96
  Policyfile.rb
98
97
  Policyfile.lock.json
99
98
 
100
- # Cookbooks #
99
+ # Documentation #
101
100
  #############
102
101
  CHANGELOG*
103
102
  CONTRIBUTING*
@@ -1,4 +1,4 @@
1
- This directory typically contains Chef cookbooks. This repository was
1
+ This directory typically contains Chef Infra cookbooks. This repository was
2
2
  generated with the '--policy-only' option, which means you have chosen
3
3
  to use a workflow where each cookbook is treated as an independent
4
4
  software project. As a result, any cookbooks present in this directory
@@ -1,4 +1,4 @@
1
- This directory contains the cookbooks used to configure systems in your infrastructure with Chef - an example basic cookbook called `example` has been automatically created for you.
1
+ This directory contains the cookbooks used to configure systems in your infrastructure with Chef Infra - an example basic cookbook called `example` has been automatically created for you.
2
2
 
3
3
  Knife needs to be configured to know where the cookbooks are located with the `cookbook_path` setting. If this is not set, then several cookbook operations will fail to work properly.
4
4
 
@@ -23,7 +23,7 @@ cookbook_email "cookbooks@example.com"
23
23
  cookbook_license "apachev2"
24
24
  ```
25
25
 
26
- Supported values for `cookbook_license` are "apachev2", "mit","gplv2","gplv3", or "none". These settings are used to prefill comments in the default recipe, and the corresponding values in the metadata.rb. You are free to change the the comments in those files.
26
+ Supported values for `cookbook_license` are "apachev2", "mit","gplv2","gplv3", or "none". These settings are used to prefill comments in the default recipe, and the corresponding values in the metadata.rb. You are free to change the comments in those files.
27
27
 
28
28
  Create new cookbooks in this directory with Chef.
29
29
 
@@ -11,11 +11,9 @@
11
11
  [local_phases]
12
12
  unit = "chef exec rspec spec/"
13
13
  lint = "chef exec cookstyle"
14
- # Foodcritic includes rules only appropriate for community cookbooks
15
- # uploaded to Supermarket. We turn off any rules tagged "supermarket"
16
- # by default. If you plan to share this cookbook you should remove
17
- # '-t ~supermarket' below to enable supermarket rules.
18
- syntax = "chef exec foodcritic . -t ~supermarket"
14
+ # foodcritic has been deprecated in favor of cookstyle so we skip the syntax
15
+ # phase now.
16
+ syntax = "echo skipping syntax phase. Use lint phase instead."
19
17
  provision = "chef exec kitchen create"
20
18
  deploy = "chef exec kitchen converge"
21
19
  smoke = "chef exec kitchen verify"
@@ -13,7 +13,7 @@ This repository contains several directories, and each directory contains a READ
13
13
 
14
14
  # Configuration
15
15
 
16
- The config file, `.chef/config.rb` is a repository-specific configuration file for the knife command line tool. If you're using the Hosted Chef platform, you can download one for your organization from the management console. You can also generate a new config.rb by running `knife configure`. For more information about configuring Knife, see the Knife documentation at https://docs.chef.io/knife.html
16
+ The config file, `.chef/config.rb` is a repository-specific configuration file for the knife command line tool. If you're using the Hosted Chef platform, you can download one for your organization from the management console. You can also generate a new config.rb by running `knife configure`. For more information about configuring Knife, see the Knife documentation at https://docs.chef.io/workstation/knife/
17
17
 
18
18
  # Next Steps
19
19
 
@@ -4,11 +4,11 @@ An example cookbook
4
4
 
5
5
  ## Requirements
6
6
 
7
- ### Platforms:
7
+ ### Platforms
8
8
 
9
9
  _No platforms defined_
10
10
 
11
- ### Cookbooks:
11
+ ### Cookbooks
12
12
 
13
13
  _No dependencies defined_
14
14
 
@@ -4,4 +4,4 @@
4
4
  # Set a default name
5
5
  default['example']['name'] = 'Sam Doe'
6
6
 
7
- # For further information, see the Chef documentation (https://docs.chef.io/attributes.html).
7
+ # For further information, see the Chef Infra documentation (https://docs.chef.io/attributes/).
@@ -5,4 +5,4 @@ log "Welcome to Chef Infra Client, #{node['example']['name']}!" do
5
5
  level :info
6
6
  end
7
7
 
8
- # For more information, see the documentation: https://docs.chef.io/recipes.html
8
+ # For more information, see the documentation: https://docs.chef.io/recipes
@@ -12,9 +12,9 @@ Then we can upload the items in the data bag's directory to the Chef Infra Serve
12
12
 
13
13
  knife data bag from file example example_item.json
14
14
 
15
- For more information on data bags, see the Chef docs site:
15
+ For more information on data bags, see the Chef Infra docs site:
16
16
 
17
- https://docs.chef.io/data_bags.html
17
+ https://docs.chef.io/data_bags/
18
18
 
19
19
  # Encrypted Data Bags
20
20
 
@@ -51,6 +51,6 @@ Use the secret_key to view the contents.
51
51
  password: abc123
52
52
 
53
53
 
54
- For more information on encrypted data bags, see the Chef docs site:
54
+ For more information on encrypted data bags, see the Chef Infra docs site:
55
55
 
56
- https://docs.chef.io/data_bags.html
56
+ https://docs.chef.io/data_bags/
@@ -4,6 +4,6 @@ For example, in this directory, you'll find an example environment file called `
4
4
 
5
5
  knife environment from file environments/example.json
6
6
 
7
- For more information on environments, see the Chef docs site:
7
+ For more information on environments, see the Chef Infra docs site:
8
8
 
9
- https://docs.chef.io/environments.html
9
+ https://docs.chef.io/environments/
@@ -4,6 +4,6 @@ For example, in this directory, you'll find an example role file called `example
4
4
 
5
5
  knife role from file roles/example.json
6
6
 
7
- For more information on roles, see the Chef docs site:
7
+ For more information on roles, see the Chef Infra docs site:
8
8
 
9
- https://docs.chef.io/roles.html
9
+ https://docs.chef.io/roles/
@@ -1,8 +1,7 @@
1
- # ~FC067 ~FC065 ~FC064
2
1
  name 'code_generator'
3
2
  maintainer 'Chef Software, Inc.'
4
3
  maintainer_email 'dev@chef.io'
5
4
  license 'Apache-2.0'
6
- description 'Generates Chef code for Chef DK'
5
+ description 'Generates Chef code for Chef CLI'
7
6
  version '0.1.0'
8
- chef_version '>= 13.0'
7
+ chef_version '>= 14.0'
@@ -11,13 +11,13 @@ directory dot_delivery_dir
11
11
 
12
12
  cookbook_file config_json do
13
13
  source 'delivery-config.json'
14
- not_if { File.exist?(config_json) }
14
+ not_if { ::File.exist?(config_json) }
15
15
  end
16
16
 
17
17
  # Adding the delivery local-mode config
18
18
  cookbook_file project_toml do
19
19
  source 'delivery-project.toml'
20
- not_if { File.exist?(project_toml) }
20
+ not_if { ::File.exist?(project_toml) }
21
21
  end
22
22
 
23
23
  generator_desc('Ensuring correct Workflow (Delivery) build cookbook content')
@@ -129,7 +129,7 @@ unless context.enable_workflow
129
129
  # Adding the delivery local-mode config
130
130
  cookbook_file "#{cookbook_dir}/.delivery/project.toml" do
131
131
  source 'delivery-project.toml'
132
- not_if { File.exist?("#{cookbook_dir}/.delivery/project.toml") }
132
+ not_if { ::File.exist?("#{cookbook_dir}/.delivery/project.toml") }
133
133
  end
134
134
  end
135
135
 
@@ -60,7 +60,7 @@ if context.have_git
60
60
  execute('initialize-git') do
61
61
  command('git init .')
62
62
  cwd repo_dir
63
- not_if { File.exist?("#{repo_dir}/.gitignore") }
63
+ not_if { ::File.exist?("#{repo_dir}/.gitignore") }
64
64
  end
65
65
  end
66
66
  template "#{repo_dir}/.gitignore" do
@@ -2,10 +2,9 @@
2
2
 
3
3
  This file is used to list changes made in each version of the <%= cookbook_name %> cookbook.
4
4
 
5
- # 0.1.0
5
+ ## 0.1.0
6
6
 
7
7
  Initial release.
8
8
 
9
9
  - change 0
10
10
  - change 1
11
-
@@ -1,7 +1,7 @@
1
1
  # Policyfile.rb - Describe how you want Chef Infra Client to build your system.
2
2
  #
3
3
  # For more information on the Policyfile feature, visit
4
- # https://docs.chef.io/policyfile.html
4
+ # https://docs.chef.io/policyfile/
5
5
 
6
6
  # A name that describes what the system you're building with Chef does.
7
7
  name '<%= policy_name %>'
@@ -1,6 +1,6 @@
1
1
  #
2
- # Chef Documentation
3
- # https://docs.chef.io/libraries.html
2
+ # Chef Infra Documentation
3
+ # https://docs.chef.io/libraries/
4
4
  #
5
5
 
6
6
  #
@@ -17,16 +17,16 @@ provisioner:
17
17
  always_update_cookbooks: true
18
18
 
19
19
  ## product_name and product_version specifies a specific Chef product and version to install.
20
- ## see the Chef documentation for more details: https://docs.chef.io/config_yml_kitchen.html
20
+ ## see the Chef documentation for more details: https://docs.chef.io/workstation/config_yml_kitchen/
21
21
  # product_name: chef
22
- # product_version: 15
22
+ # product_version: 16
23
23
 
24
24
  verifier:
25
25
  name: inspec
26
26
 
27
27
  platforms:
28
- - name: ubuntu-18.04
29
- - name: centos-7
28
+ - name: ubuntu-20.04
29
+ - name: centos-8
30
30
 
31
31
  suites:
32
32
  - name: default
@@ -14,16 +14,16 @@ verifier:
14
14
  platforms:
15
15
  # @see https://github.com/chef-cookbooks/testing_examples/blob/master/kitchen.dokken.yml
16
16
  # @see https://hub.docker.com/u/dokken
17
- - name: ubuntu-18.04
17
+ - name: ubuntu-20.04
18
18
  driver:
19
- image: dokken/ubuntu-18.04
19
+ image: dokken/ubuntu-20.04
20
20
  pid_one_command: /bin/systemd
21
21
  intermediate_instructions:
22
22
  - RUN /usr/bin/apt-get update
23
23
 
24
- - name: centos-7
24
+ - name: centos-8
25
25
  driver:
26
- image: dokken/centos-7
26
+ image: dokken/centos-8
27
27
  pid_one_command: /usr/lib/systemd/systemd
28
28
 
29
29
  suites:
@@ -13,16 +13,16 @@ provisioner:
13
13
  name: chef_zero
14
14
 
15
15
  ## product_name and product_version specifies a specific Chef product and version to install.
16
- ## see the Chef documentation for more details: https://docs.chef.io/config_yml_kitchen.html
16
+ ## see the Chef documentation for more details: https://docs.chef.io/workstation/config_yml_kitchen/
17
17
  # product_name: chef
18
- # product_version: 15
18
+ # product_version: 16
19
19
 
20
20
  verifier:
21
21
  name: inspec
22
22
 
23
23
  platforms:
24
- - name: ubuntu-18.04
25
- - name: centos-7
24
+ - name: ubuntu-20.04
25
+ - name: centos-8
26
26
 
27
27
  suites:
28
28
  - name: default
@@ -3,7 +3,6 @@ maintainer '<%= copyright_holder %>'
3
3
  maintainer_email '<%= email %>'
4
4
  license '<%= @spdx_license %>'
5
5
  description 'Installs/Configures <%= cookbook_name %>'
6
- long_description 'Installs/Configures <%= cookbook_name %>'
7
6
  version '0.1.0'
8
7
  chef_version '>= 14.0'
9
8
 
@@ -7,20 +7,20 @@
7
7
  require 'spec_helper'
8
8
 
9
9
  describe '<%= cookbook_name %>::<%= recipe_name %>' do
10
- context 'When all attributes are default, on Ubuntu 18.04' do
10
+ context 'When all attributes are default, on Ubuntu 20.04' do
11
11
  # for a complete list of available platforms and versions see:
12
12
  # https://github.com/chefspec/fauxhai/blob/master/PLATFORMS.md
13
- platform 'ubuntu', '18.04'
13
+ platform 'ubuntu', '20.04'
14
14
 
15
15
  it 'converges successfully' do
16
16
  expect { chef_run }.to_not raise_error
17
17
  end
18
18
  end
19
19
 
20
- context 'When all attributes are default, on CentOS 7' do
20
+ context 'When all attributes are default, on CentOS 8' do
21
21
  # for a complete list of available platforms and versions see:
22
22
  # https://github.com/chefspec/fauxhai/blob/master/PLATFORMS.md
23
- platform 'centos', '7'
23
+ platform 'centos', '8'
24
24
 
25
25
  it 'converges successfully' do
26
26
  expect { chef_run }.to_not raise_error
@@ -1 +1 @@
1
- # To learn more about Custom Resources, see https://docs.chef.io/custom_resources.html
1
+ # To learn more about Custom Resources, see https://docs.chef.io/custom_resources/
@@ -16,5 +16,5 @@
16
16
  #
17
17
 
18
18
  module ChefCLI
19
- VERSION = "1.0.14".freeze
19
+ VERSION = "3.0.4".freeze
20
20
  end
@@ -0,0 +1,90 @@
1
+ # -*- encoding: utf-8 -*-
2
+ #
3
+ # Author:: Marc Paradise <marc@chef.io>
4
+ #
5
+ # Copyright (C) 2020, Chef Software Inc
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ require "json"
20
+ require "kitchen"
21
+ require "kitchen/provisioner/base"
22
+ require "kitchen/provisioner/chef_zero"
23
+
24
+ module Kitchen
25
+ module Provisioner
26
+ # For use in a provisioner that does not do any run list evaluation or
27
+ # policy/berks file expansion.
28
+ class ChefZeroCaptureSandbox < Chef::CommonSandbox
29
+ def populate
30
+ super
31
+ prepare(:policies)
32
+ prepare(:policy_groups)
33
+ prepare(:cookbook_artifacts)
34
+ end
35
+
36
+ # Override #prepare_cookbooks because we don't want any cookbook resolving to occur
37
+ # via kitchen through berks, policy
38
+ def prepare_cookbooks
39
+ cp_cookbooks
40
+ filter_only_cookbook_files
41
+ end
42
+ end
43
+
44
+ # chef-zero provisioner intended for use with `chef capture`.
45
+ #
46
+ # This provisioner does not do any cookbook dependency
47
+ # resolution and will not pull in external cookbooks. All cookbooks
48
+ # or cookbook artificats + policy data as captured from the live node and are
49
+ # expected to be available for chef-zero to provide to the client.
50
+ class ChefZeroCapture < ChefZero
51
+ # Declaring these ensure that they're available to the sandbox - it's initialized
52
+ # the provider's configoptions.
53
+ default_config :policies_path, "policies"
54
+ default_config :policy_groups_path, "policy_groups"
55
+ default_config :cookbook_artifacts_path, "cookbook_artifacts"
56
+
57
+ # This will load policyfile/berkshelf. We don't want either - the client resolves all
58
+ # dependencies from chef-zero, exactly as preppped in the captured repository.
59
+ def load_needed_dependencies!; end
60
+
61
+ def create_sandbox
62
+ # We have to invoke the the true Base create_sandbox because it does setup that
63
+ # we want. However, we do not want to invoke the create_sandbox inherited from
64
+ # ChefZero/ChefBase - those will create and populate a ChefCommonSandbox instead
65
+ # of a ChefZeroCaptureSandbox.
66
+ m = Base.instance_method(:create_sandbox).bind(self)
67
+ m.call
68
+
69
+ # These behaviors from super we _do_ want, so we need to copy them here.
70
+ prepare_validation_pem
71
+ prepare_config_rb
72
+ ChefZeroCaptureSandbox.new(config, sandbox_path, instance).populate
73
+ end
74
+
75
+ # Overriding the private ProviderChefZero#default_config_rb
76
+ # so that we can add additional configuratoin required for chef-zeor
77
+ # to be able to locate our policies/, policy groups, and cookbook artifacts
78
+ # at run-time.
79
+ def default_config_rb
80
+ cfg = super
81
+ # Need to tell chef-zero about our additional config.
82
+ root = config[:root_path].gsub("$env:TEMP", "\#{ENV['TEMP']\}")
83
+ cfg[:policies_path] = remote_path_join(root, config[:policies_path])
84
+ cfg[:policy_groups_path] = remote_path_join(root, config[:policy_groups_path])
85
+ cfg[:cookbook_artifacts_path] = remote_path_join(root, config[:cookbook_artifacts_path])
86
+ cfg
87
+ end
88
+ end
89
+ end
90
+ end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright (c) 2014-2019 Chef Software Inc.
2
+ # Copyright:: Copyright (c) 2014-2020 Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -129,7 +129,7 @@ describe ChefCLI::Command::GeneratorCommands::Cookbook do
129
129
 
130
130
  it "warns if a hyphenated cookbook name is passed" do
131
131
  expect(with_argv(%w{my-cookbook}).run).to eq(0)
132
- message = "Hyphens are discouraged in cookbook names as they may cause problems with custom resources. See https://docs.chef.io/ctl_chef.html#chef-generate-cookbook for more information."
132
+ message = "Hyphens are discouraged in cookbook names as they may cause problems with custom resources. See https://docs.chef.io/ctl_chef/#chef-generate-cookbook for more information."
133
133
  expect(stdout_io.string).to include(message)
134
134
  end
135
135
 
@@ -197,11 +197,9 @@ describe ChefCLI::Command::GeneratorCommands::Cookbook do
197
197
  [local_phases]
198
198
  unit = "chef exec rspec spec/"
199
199
  lint = "chef exec cookstyle"
200
- # Foodcritic includes rules only appropriate for community cookbooks
201
- # uploaded to Supermarket. We turn off any rules tagged "supermarket"
202
- # by default. If you plan to share this cookbook you should remove
203
- # '-t ~supermarket' below to enable supermarket rules.
204
- syntax = "chef exec foodcritic . -t ~supermarket"
200
+ # foodcritic has been deprecated in favor of cookstyle so we skip the syntax
201
+ # phase now.
202
+ syntax = "echo skipping syntax phase. Use lint phase instead."
205
203
  provision = "chef exec kitchen create"
206
204
  deploy = "chef exec kitchen converge"
207
205
  smoke = "chef exec kitchen verify"
@@ -271,7 +269,7 @@ describe ChefCLI::Command::GeneratorCommands::Cookbook do
271
269
  # Cookbook:: build_cookbook
272
270
  # Recipe:: publish
273
271
  #
274
- # Copyright:: 2019, The Authors, All Rights Reserved.
272
+ # Copyright:: #{DateTime.now.year}, The Authors, All Rights Reserved.
275
273
 
276
274
  include_recipe 'delivery-truck::publish'
277
275
  CONFIG_DOT_JSON
@@ -525,7 +523,7 @@ describe ChefCLI::Command::GeneratorCommands::Cookbook do
525
523
  # Policyfile.rb - Describe how you want Chef Infra Client to build your system.
526
524
  #
527
525
  # For more information on the Policyfile feature, visit
528
- # https://docs.chef.io/policyfile.html
526
+ # https://docs.chef.io/policyfile/
529
527
 
530
528
  # A name that describes what the system you're building with Chef does.
531
529
  name 'new_cookbook'
@@ -573,16 +571,16 @@ describe ChefCLI::Command::GeneratorCommands::Cookbook do
573
571
  name: chef_zero
574
572
 
575
573
  ## product_name and product_version specifies a specific Chef product and version to install.
576
- ## see the Chef documentation for more details: https://docs.chef.io/config_yml_kitchen.html
574
+ ## see the Chef documentation for more details: https://docs.chef.io/workstation/config_yml_kitchen/
577
575
  # product_name: chef
578
- # product_version: 15
576
+ # product_version: 16
579
577
 
580
578
  verifier:
581
579
  name: inspec
582
580
 
583
581
  platforms:
584
- - name: ubuntu-18.04
585
- - name: centos-7
582
+ - name: ubuntu-20.04
583
+ - name: centos-8
586
584
 
587
585
  suites:
588
586
  - name: default
@@ -660,16 +658,16 @@ describe ChefCLI::Command::GeneratorCommands::Cookbook do
660
658
  always_update_cookbooks: true
661
659
 
662
660
  ## product_name and product_version specifies a specific Chef product and version to install.
663
- ## see the Chef documentation for more details: https://docs.chef.io/config_yml_kitchen.html
661
+ ## see the Chef documentation for more details: https://docs.chef.io/workstation/config_yml_kitchen/
664
662
  # product_name: chef
665
- # product_version: 15
663
+ # product_version: 16
666
664
 
667
665
  verifier:
668
666
  name: inspec
669
667
 
670
668
  platforms:
671
- - name: ubuntu-18.04
672
- - name: centos-7
669
+ - name: ubuntu-20.04
670
+ - name: centos-8
673
671
 
674
672
  suites:
675
673
  - name: default