chef-dk 4.6.35 → 4.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +21 -32
- data/Gemfile.lock +451 -466
- data/Rakefile +0 -16
- data/lib/chef-dk/command/verify.rb +5 -46
- data/lib/chef-dk/skeletons/code_generator/files/default/build_cookbook/README.md +1 -1
- data/lib/chef-dk/skeletons/code_generator/recipes/build_cookbook.rb +2 -2
- data/lib/chef-dk/skeletons/code_generator/recipes/cookbook.rb +1 -1
- data/lib/chef-dk/skeletons/code_generator/recipes/repo.rb +1 -1
- data/lib/chef-dk/version.rb +1 -1
- data/spec/unit/command/generator_commands/cookbook_spec.rb +1 -1
- data/spec/unit/command/verify_spec.rb +1 -2
- metadata +2 -2
data/Rakefile
CHANGED
@@ -58,20 +58,4 @@ namespace :style do
|
|
58
58
|
rescue LoadError => e
|
59
59
|
puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV["CI"]
|
60
60
|
end
|
61
|
-
|
62
|
-
begin
|
63
|
-
require "foodcritic"
|
64
|
-
|
65
|
-
desc "Run Chef Cookbook (Foodcritic) style checks"
|
66
|
-
FoodCritic::Rake::LintTask.new(:foodcritic) do |t|
|
67
|
-
t.options = {
|
68
|
-
fail_tags: ["any"],
|
69
|
-
tags: ["~FC071", "~supermarket", "~FC031"],
|
70
|
-
cookbook_paths: ["lib/chef-dk/skeletons/code_generator"],
|
71
|
-
progress: true,
|
72
|
-
}
|
73
|
-
end
|
74
|
-
rescue LoadError => e
|
75
|
-
puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV["CI"]
|
76
|
-
end
|
77
61
|
end
|
@@ -118,43 +118,6 @@ module ChefDK
|
|
118
118
|
c.smoke_test { run_in_tmpdir("kitchen init --create-gemfile") }
|
119
119
|
end
|
120
120
|
|
121
|
-
add_component "tk-policyfile-provisioner" do |c|
|
122
|
-
|
123
|
-
c.gem_base_dir = "chef-dk"
|
124
|
-
|
125
|
-
c.smoke_test do
|
126
|
-
tmpdir do |cwd|
|
127
|
-
File.open(File.join(cwd, "kitchen.yml"), "w+") do |f|
|
128
|
-
f.print(<<~KITCHEN_YML)
|
129
|
-
---
|
130
|
-
driver:
|
131
|
-
name: dummy
|
132
|
-
network:
|
133
|
-
- ["forwarded_port", {guest: 80, host: 8080}]
|
134
|
-
|
135
|
-
provisioner:
|
136
|
-
name: policyfile_zero
|
137
|
-
require_chef_omnibus: 12.3.0
|
138
|
-
|
139
|
-
platforms:
|
140
|
-
- name: ubuntu-14.04
|
141
|
-
|
142
|
-
suites:
|
143
|
-
- name: default
|
144
|
-
run_list:
|
145
|
-
- recipe[aar::default]
|
146
|
-
attributes:
|
147
|
-
|
148
|
-
KITCHEN_YML
|
149
|
-
end
|
150
|
-
|
151
|
-
sh("kitchen list", cwd: cwd)
|
152
|
-
|
153
|
-
end
|
154
|
-
end
|
155
|
-
|
156
|
-
end
|
157
|
-
|
158
121
|
add_component "chef-client" do |c|
|
159
122
|
c.gem_base_dir = "chef"
|
160
123
|
c.unit_test do
|
@@ -185,20 +148,16 @@ module ChefDK
|
|
185
148
|
end
|
186
149
|
end
|
187
150
|
|
188
|
-
add_component "chef-apply" do |c|
|
189
|
-
c.gem_base_dir = "chef-apply"
|
190
|
-
# c.unit_test do
|
191
|
-
# bundle_install_mutex.synchronize { sh("#{embedded_bin("bundle")} install") }
|
192
|
-
# sh("#{embedded_bin("bundle")} exec rspec")
|
193
|
-
# end
|
194
|
-
c.smoke_test { sh("#{bin("chef-run")} -v") }
|
195
|
-
end
|
196
|
-
|
197
151
|
add_component "foodcritic" do |c|
|
198
152
|
c.gem_base_dir = "foodcritic"
|
199
153
|
c.smoke_test { sh("#{embedded_bin("foodcritic --list")}") } # foodcritic -v exits with 2 so use --list which exits 0
|
200
154
|
end
|
201
155
|
|
156
|
+
add_component "cookstyle" do |c|
|
157
|
+
c.gem_base_dir = "cookstyle"
|
158
|
+
c.smoke_test { sh("#{embedded_bin("cookstyle -v")}") }
|
159
|
+
end
|
160
|
+
|
202
161
|
add_component "chefspec" do |c|
|
203
162
|
c.gem_base_dir = "chefspec"
|
204
163
|
c.unit_test do
|
@@ -129,7 +129,7 @@ delivery review
|
|
129
129
|
|
130
130
|
## FAQ
|
131
131
|
|
132
|
-
### Why don't I just run rspec and
|
132
|
+
### Why don't I just run rspec and cookstyle/chefspec on my local system?
|
133
133
|
|
134
134
|
An objection to the Test Kitchen approach is that it is much faster to run the unit, lint, and syntax commands for the project on the local system. That is totally true, and also totally valid. Do that for the really fast feedback loop. However, the dance we do with Test Kitchen brings a much higher degree of confidence in the changes we're making, that everything will run on the build nodes in Chef Workflow. We strongly encourage this approach before actually pushing the changes to Workflow.
|
135
135
|
|
@@ -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
|
|
data/lib/chef-dk/version.rb
CHANGED
@@ -271,7 +271,7 @@ describe ChefDK::Command::GeneratorCommands::Cookbook do
|
|
271
271
|
# Cookbook:: build_cookbook
|
272
272
|
# Recipe:: publish
|
273
273
|
#
|
274
|
-
# Copyright::
|
274
|
+
# Copyright:: 2020, The Authors, All Rights Reserved.
|
275
275
|
|
276
276
|
include_recipe 'delivery-truck::publish'
|
277
277
|
CONFIG_DOT_JSON
|
@@ -38,12 +38,12 @@ describe ChefDK::Command::Verify do
|
|
38
38
|
let(:default_components) do
|
39
39
|
[
|
40
40
|
"berkshelf",
|
41
|
-
"chef-apply",
|
42
41
|
"chef-client",
|
43
42
|
"chef-dk",
|
44
43
|
"chef-sugar",
|
45
44
|
"chef-vault",
|
46
45
|
"chefspec",
|
46
|
+
"cookstyle",
|
47
47
|
"delivery-cli",
|
48
48
|
"fauxhai",
|
49
49
|
"foodcritic",
|
@@ -55,7 +55,6 @@ describe ChefDK::Command::Verify do
|
|
55
55
|
"opscode-pushy-client",
|
56
56
|
"package installation",
|
57
57
|
"test-kitchen",
|
58
|
-
"tk-policyfile-provisioner",
|
59
58
|
]
|
60
59
|
end
|
61
60
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-dk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel DeLeo
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-10-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mixlib-cli
|