chef-dk 0.17.17 → 0.18.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +11 -14
- data/Gemfile.lock +162 -139
- data/acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml +0 -1
- data/acceptance/Gemfile.lock +73 -68
- data/chef-dk.gemspec +3 -9
- data/lib/chef-dk/command/clean_policy_cookbooks.rb +1 -2
- data/lib/chef-dk/command/clean_policy_revisions.rb +1 -1
- data/lib/chef-dk/command/delete_policy.rb +1 -1
- data/lib/chef-dk/command/delete_policy_group.rb +1 -1
- data/lib/chef-dk/command/export.rb +1 -1
- data/lib/chef-dk/command/generator_commands/build_cookbook.rb +11 -1
- data/lib/chef-dk/command/generator_commands/cookbook.rb +11 -2
- data/lib/chef-dk/command/install.rb +1 -1
- data/lib/chef-dk/command/push.rb +1 -1
- data/lib/chef-dk/command/push_archive.rb +1 -1
- data/lib/chef-dk/command/show_policy.rb +1 -1
- data/lib/chef-dk/command/undelete.rb +1 -1
- data/lib/chef-dk/command/update.rb +1 -1
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/cookbooks/example/recipes/default.rb +1 -1
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/data_bags/README.md +2 -2
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/roles/README.md +1 -1
- data/lib/chef-dk/skeletons/code_generator/recipes/build_cookbook.rb +4 -3
- data/lib/chef-dk/skeletons/code_generator/templates/default/Policyfile.rb.erb +1 -1
- data/lib/chef-dk/version.rb +1 -1
- data/omnibus_overrides.rb +1 -2
- data/spec/unit/command/generator_commands/cookbook_spec.rb +5 -5
- data/spec/unit/command/generator_commands/policyfile_spec.rb +1 -1
- data/spec/unit/command/generator_commands/repo_spec.rb +1 -1
- data/tasks/dependencies.rb +2 -1
- data/tasks/version.rb +28 -3
- data/version_policy.rb +22 -22
- metadata +5 -11
@@ -14,7 +14,7 @@ Then we can upload the items in the data bag's directory to the Chef Server.
|
|
14
14
|
|
15
15
|
For more information on data bags, see the Chef wiki page:
|
16
16
|
|
17
|
-
https://docs.chef.io/
|
17
|
+
https://docs.chef.io/data_bags.html
|
18
18
|
|
19
19
|
# Encrypted Data Bags
|
20
20
|
|
@@ -53,4 +53,4 @@ Use the secret_key to view the contents.
|
|
53
53
|
|
54
54
|
For more information on encrypted data bags, see the Chef wiki page:
|
55
55
|
|
56
|
-
https://docs.chef.io/
|
56
|
+
https://docs.chef.io/data_bags.html
|
@@ -1,6 +1,7 @@
|
|
1
1
|
|
2
2
|
context = ChefDK::Generator.context
|
3
3
|
delivery_project_dir = context.delivery_project_dir
|
4
|
+
pipeline = context.pipeline
|
4
5
|
dot_delivery_dir = File.join(delivery_project_dir, ".delivery")
|
5
6
|
|
6
7
|
generator_desc("Ensuring delivery configuration")
|
@@ -156,8 +157,8 @@ if context.have_git && context.delivery_project_git_initialized && !context.skip
|
|
156
157
|
only_if "git status --porcelain |grep \".\""
|
157
158
|
end
|
158
159
|
|
159
|
-
execute("git-return-to-
|
160
|
-
command("git checkout
|
160
|
+
execute("git-return-to-#{pipeline}-branch") do
|
161
|
+
command("git checkout #{pipeline}")
|
161
162
|
cwd delivery_project_dir
|
162
163
|
end
|
163
164
|
|
@@ -169,7 +170,7 @@ if context.have_git && context.delivery_project_git_initialized && !context.skip
|
|
169
170
|
end
|
170
171
|
|
171
172
|
execute("git-remove-delivery-config-branch") do
|
172
|
-
command("git branch -
|
173
|
+
command("git branch -D add-delivery-configuration")
|
173
174
|
cwd delivery_project_dir
|
174
175
|
end
|
175
176
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Policyfile.rb - Describe how you want Chef to build your system.
|
2
2
|
#
|
3
3
|
# For more information on the Policyfile feature, visit
|
4
|
-
# https://
|
4
|
+
# https://docs.chef.io/policyfile.html
|
5
5
|
|
6
6
|
# A name that describes what the system you're building with Chef does.
|
7
7
|
name "<%= policy_name %>"
|
data/lib/chef-dk/version.rb
CHANGED
data/omnibus_overrides.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
# DO NOT EDIT. Generated by "rake dependencies". Edit version_policy.rb instead.
|
2
|
-
override :rubygems, version: "2.6.6"
|
3
2
|
override :bundler, version: "1.12.5"
|
4
3
|
override "libffi", version: "3.2.1"
|
5
4
|
override "libiconv", version: "1.14"
|
@@ -11,7 +10,7 @@ override "libyaml", version: "0.1.6"
|
|
11
10
|
override "makedepend", version: "1.0.5"
|
12
11
|
override "ncurses", version: "5.9"
|
13
12
|
override "pkg-config-lite", version: "0.28-1"
|
14
|
-
override "ruby", version: "2.1
|
13
|
+
override "ruby", version: "2.3.1"
|
15
14
|
override "ruby-windows-devkit-bash", version: "3.1.23-4-msys-1.0.18"
|
16
15
|
override "util-macros", version: "1.19.0"
|
17
16
|
override "xproto", version: "7.0.28"
|
@@ -126,10 +126,10 @@ EOF
|
|
126
126
|
expect(stderr_io.string).to include(message)
|
127
127
|
end
|
128
128
|
|
129
|
-
it "
|
130
|
-
expect(with_argv(%w{my-cookbook}).run).to eq(
|
131
|
-
message = "Hyphens are
|
132
|
-
expect(
|
129
|
+
it "warns if a hyphenated cookbook name is passed" do
|
130
|
+
expect(with_argv(%w{my-cookbook}).run).to eq(0)
|
131
|
+
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
|
+
expect(stdout_io.string).to include(message)
|
133
133
|
end
|
134
134
|
|
135
135
|
end
|
@@ -503,7 +503,7 @@ OUTPUT
|
|
503
503
|
# Policyfile.rb - Describe how you want Chef to build your system.
|
504
504
|
#
|
505
505
|
# For more information on the Policyfile feature, visit
|
506
|
-
# https://
|
506
|
+
# https://docs.chef.io/policyfile.html
|
507
507
|
|
508
508
|
# A name that describes what the system you're building with Chef does.
|
509
509
|
name "new_cookbook"
|
@@ -118,7 +118,7 @@ describe ChefDK::Command::GeneratorCommands::Policyfile do
|
|
118
118
|
# Policyfile.rb - Describe how you want Chef to build your system.
|
119
119
|
#
|
120
120
|
# For more information on the Policyfile feature, visit
|
121
|
-
# https://
|
121
|
+
# https://docs.chef.io/policyfile.html
|
122
122
|
|
123
123
|
# A name that describes what the system you're building with Chef does.
|
124
124
|
name "my-app-frontend"
|
@@ -333,7 +333,7 @@ For example, in this directory you'll find an example role file called `example.
|
|
333
333
|
|
334
334
|
For more information on roles, see the Chef wiki page:
|
335
335
|
|
336
|
-
https://docs.chef.io/
|
336
|
+
https://docs.chef.io/roles.html
|
337
337
|
README
|
338
338
|
end
|
339
339
|
|
data/tasks/dependencies.rb
CHANGED
@@ -24,8 +24,9 @@ desc "Tasks to update and check dependencies"
|
|
24
24
|
namespace :dependencies do
|
25
25
|
# Update all dependencies to the latest constraint-matching version
|
26
26
|
desc "Update all dependencies."
|
27
|
+
# Until 12.14 is released we've removed this first task from update
|
28
|
+
# dependencies:update_stable_channel_gems
|
27
29
|
task :update => %w{
|
28
|
-
dependencies:update_stable_channel_gems
|
29
30
|
dependencies:update_gemfile_lock
|
30
31
|
dependencies:update_omnibus_overrides
|
31
32
|
dependencies:update_omnibus_gemfile_lock
|
data/tasks/version.rb
CHANGED
@@ -17,17 +17,29 @@
|
|
17
17
|
|
18
18
|
namespace :version do
|
19
19
|
desc "Bump patch version in lib/chef-dk/version.rb and update Gemfile*.lock conservatively to include the new version. If Gemfile has changed, this will update modified constraints as well."
|
20
|
-
task :bump => %w{version:bump_patch
|
20
|
+
task :bump => %w{version:bump_patch version:update_gemfile_lock}
|
21
21
|
|
22
22
|
desc "Show the current version."
|
23
23
|
task :show do
|
24
|
-
puts
|
24
|
+
puts version
|
25
|
+
end
|
26
|
+
|
27
|
+
def version
|
28
|
+
if IO.read(version_rb_path) =~ /^\s*VERSION\s*=\s*"([^"]+)"\s*$/
|
29
|
+
$1
|
30
|
+
else
|
31
|
+
raise "Could not read version from #{version_rb_path}. Contents:\n#{IO.read(version_rb_path)}"
|
32
|
+
end
|
25
33
|
end
|
26
34
|
|
27
35
|
def version_rb_path
|
28
36
|
File.expand_path("../../lib/chef-dk/version.rb", __FILE__)
|
29
37
|
end
|
30
38
|
|
39
|
+
def gemfile_lock_path
|
40
|
+
File.expand_path("../../Gemfile.lock", __FILE__)
|
41
|
+
end
|
42
|
+
|
31
43
|
# Add 1 to the current patch version in the VERSION file, and write it back out.
|
32
44
|
desc "Bump the patch version in lib/chef-dk/version.rb."
|
33
45
|
task :bump_patch do
|
@@ -37,8 +49,21 @@ namespace :version do
|
|
37
49
|
new_version = "#{$2}#{$3.to_i + 1}"
|
38
50
|
"#{$1}#{new_version}"
|
39
51
|
end
|
40
|
-
puts "Updating version in #{version_rb_path} from #{
|
52
|
+
puts "Updating version in #{version_rb_path} from #{version} to #{new_version.chomp}"
|
41
53
|
IO.write(version_rb_path, new_version_file)
|
42
54
|
end
|
43
55
|
|
56
|
+
desc "Update the Gemfile.lock to include the current chef-dk version"
|
57
|
+
task :update_gemfile_lock do
|
58
|
+
if File.exist?(gemfile_lock_path)
|
59
|
+
puts "Updating #{gemfile_lock_path} to include version #{version} ..."
|
60
|
+
contents = IO.read(gemfile_lock_path)
|
61
|
+
contents.gsub!(/^\s*(chef-dk)\s*\((= )?\S+\)\s*$/) do |line|
|
62
|
+
line.gsub(/\((= )?\d+(\.\d+)+/) { "(#{$1}#{version}" }
|
63
|
+
end
|
64
|
+
IO.write(gemfile_lock_path, contents)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
|
44
69
|
end
|
data/version_policy.rb
CHANGED
@@ -17,6 +17,8 @@
|
|
17
17
|
|
18
18
|
# Explicit omnibus overrides.
|
19
19
|
OMNIBUS_OVERRIDES = {
|
20
|
+
# Until 1.13.0 is released
|
21
|
+
:bundler => "1.12.5",
|
20
22
|
# Lower level library pins
|
21
23
|
## according to comment in omnibus-sw, latest versions don't work on solaris
|
22
24
|
# https://github.com/chef/omnibus-software/blob/aefb7e79d29ca746c3f843673ef5e317fa3cba54/config/software/libtool.rb#L23
|
@@ -32,7 +34,7 @@ OMNIBUS_OVERRIDES = {
|
|
32
34
|
"makedepend" => "1.0.5",
|
33
35
|
"ncurses" => "5.9",
|
34
36
|
"pkg-config-lite" => "0.28-1",
|
35
|
-
"ruby" => "2.1
|
37
|
+
"ruby" => "2.3.1",
|
36
38
|
# Leave dev-kit pinned to 4.5 on 32-bit, because 4.7 is 20MB larger and we don't want
|
37
39
|
# to unnecessarily make the client any fatter. (Since it's different between
|
38
40
|
# 32 and 64, we have to do it in the project file still.)
|
@@ -58,8 +60,8 @@ OMNIBUS_OVERRIDES = {
|
|
58
60
|
# name of the rubygem (gem list -re <rubygem name> gets us the latest version).
|
59
61
|
#
|
60
62
|
OMNIBUS_RUBYGEMS_AT_LATEST_VERSION = {
|
61
|
-
rubygems: "rubygems-update",
|
62
|
-
bundler: "bundler",
|
63
|
+
#rubygems: "rubygems-update", # pinned to 2.6.4 until https://github.com/rubygems/rubygems/pull/1683 is released
|
64
|
+
# bundler: "bundler", # pinned to 1.12.5 until we figure out how we're failing on 1.13.0
|
63
65
|
}
|
64
66
|
|
65
67
|
#
|
@@ -71,25 +73,22 @@ OMNIBUS_RUBYGEMS_AT_LATEST_VERSION = {
|
|
71
73
|
# list of outdated gems.
|
72
74
|
#
|
73
75
|
ACCEPTABLE_OUTDATED_GEMS = [
|
74
|
-
"
|
75
|
-
"celluloid
|
76
|
-
"
|
77
|
-
"
|
78
|
-
"fog-
|
79
|
-
"
|
80
|
-
"google
|
81
|
-
"
|
82
|
-
"
|
83
|
-
"
|
84
|
-
"
|
85
|
-
"retriable",
|
86
|
-
"rubocop",
|
87
|
-
"slop",
|
88
|
-
"timers",
|
89
|
-
|
90
|
-
"varia_model",
|
91
|
-
"httpclient",
|
92
|
-
"molinillo",
|
76
|
+
"activesupport", # anchored by outdated google-api-client
|
77
|
+
"celluloid", # ridley requires 0.16.x
|
78
|
+
"celluloid-io", # ridley requires 0.16.x
|
79
|
+
"cucumber-core", # Until cucumber 2.0
|
80
|
+
"fog-cloudatcost", # fog restricts this for probably no good reason
|
81
|
+
"fog-dynect", # fog restricts this for probably no good reason
|
82
|
+
"fog-google", # fog-google 0.2+ requires Ruby 2.0+, fog 2.0.0 will include it
|
83
|
+
"google-api-client", # chef-provisioning-fog restricts to < 0.9 for presently unknown reasons
|
84
|
+
"json", # inspec pins this because Ruby 2.0, no eta on fix
|
85
|
+
"rack", # chef-zero pins this because Ruby 2.0, no eta on fix
|
86
|
+
"rbvmomi", # fog-vsphere restricts this to a patch version, not sure why
|
87
|
+
"retriable", # anchored by outdated google-api-client
|
88
|
+
"rubocop", # cookstyle pins to 0.39.0 in 0.0.1
|
89
|
+
"slop", # expected to disappear with pry 0.11
|
90
|
+
"timers", # anchored by outdated celluloid
|
91
|
+
|
93
92
|
# We have a task called update_stable_channel_gems which scans and pins to the
|
94
93
|
# latest released chef/chef-config/opscode-pushy-client but it pulls from the
|
95
94
|
# chef repo instead of from rubygems. Bundler currently considers any git
|
@@ -102,6 +101,7 @@ ACCEPTABLE_OUTDATED_GEMS = [
|
|
102
101
|
"chef-config",
|
103
102
|
"opscode-pushy-client",
|
104
103
|
"mixlib-cli"
|
104
|
+
|
105
105
|
]
|
106
106
|
|
107
107
|
#
|
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: 0.
|
4
|
+
version: 0.18.26
|
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: 2016-
|
13
|
+
date: 2016-09-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mixlib-cli
|
@@ -92,9 +92,6 @@ dependencies:
|
|
92
92
|
name: solve
|
93
93
|
requirement: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- - "~>"
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version: '2.0'
|
98
95
|
- - ">="
|
99
96
|
- !ruby/object:Gem::Version
|
100
97
|
version: 2.0.1
|
@@ -102,9 +99,6 @@ dependencies:
|
|
102
99
|
prerelease: false
|
103
100
|
version_requirements: !ruby/object:Gem::Requirement
|
104
101
|
requirements:
|
105
|
-
- - "~>"
|
106
|
-
- !ruby/object:Gem::Version
|
107
|
-
version: '2.0'
|
108
102
|
- - ">="
|
109
103
|
- !ruby/object:Gem::Version
|
110
104
|
version: 2.0.1
|
@@ -162,14 +156,14 @@ dependencies:
|
|
162
156
|
requirements:
|
163
157
|
- - "~>"
|
164
158
|
- !ruby/object:Gem::Version
|
165
|
-
version: '
|
159
|
+
version: '2.0'
|
166
160
|
type: :runtime
|
167
161
|
prerelease: false
|
168
162
|
version_requirements: !ruby/object:Gem::Requirement
|
169
163
|
requirements:
|
170
164
|
- - "~>"
|
171
165
|
- !ruby/object:Gem::Version
|
172
|
-
version: '
|
166
|
+
version: '2.0'
|
173
167
|
- !ruby/object:Gem::Dependency
|
174
168
|
name: github_changelog_generator
|
175
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -642,7 +636,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
642
636
|
requirements:
|
643
637
|
- - ">="
|
644
638
|
- !ruby/object:Gem::Version
|
645
|
-
version: '2.
|
639
|
+
version: '2.2'
|
646
640
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
647
641
|
requirements:
|
648
642
|
- - ">="
|