chef-dk 1.6.11 → 2.0.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +25 -38
- data/Gemfile.lock +199 -199
- data/README.md +4 -2
- data/Rakefile +1 -2
- data/acceptance/Gemfile +1 -1
- data/acceptance/Gemfile.lock +23 -21
- data/chef-dk.gemspec +4 -6
- data/lib/chef-dk/builtin_commands.rb +1 -1
- data/lib/chef-dk/chef_runner.rb +1 -1
- data/lib/chef-dk/cli.rb +1 -0
- data/lib/chef-dk/command/generate.rb +5 -2
- data/lib/chef-dk/command/generator_commands/helpers.rb +36 -0
- data/lib/chef-dk/command/generator_commands/{lwrp.rb → resource.rb} +4 -4
- data/lib/chef-dk/command/update.rb +11 -18
- data/lib/chef-dk/command/verify.rb +1 -16
- data/lib/chef-dk/commands_map.rb +3 -3
- data/lib/chef-dk/policyfile/artifactory_cookbook_source.rb +102 -0
- data/lib/chef-dk/policyfile/cookbook_location_specification.rb +2 -2
- data/lib/chef-dk/policyfile/cookbook_sources.rb +1 -0
- data/lib/chef-dk/policyfile/dsl.rb +10 -0
- data/lib/chef-dk/policyfile/solution_dependencies.rb +15 -1
- data/lib/chef-dk/policyfile_lock.rb +1 -1
- data/lib/chef-dk/policyfile_services/install.rb +30 -2
- data/lib/chef-dk/skeletons/code_generator/files/default/Berksfile +1 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/build_cookbook/test-fixture-recipe.rb +1 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/cookbook_readmes/README.md +2 -2
- data/lib/chef-dk/skeletons/code_generator/files/default/delivery-config.json +3 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/delivery-project.toml +1 -1
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/cookbooks/example/attributes/default.rb +1 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/cookbooks/example/metadata.rb +2 -1
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/cookbooks/example/recipes/default.rb +1 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/spec_helper.rb +1 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/spec_helper_policyfile.rb +1 -0
- data/lib/chef-dk/skeletons/code_generator/metadata.rb +3 -2
- data/lib/chef-dk/skeletons/code_generator/recipes/app.rb +1 -1
- data/lib/chef-dk/skeletons/code_generator/recipes/attribute.rb +1 -0
- data/lib/chef-dk/skeletons/code_generator/recipes/build_cookbook.rb +7 -12
- data/lib/chef-dk/skeletons/code_generator/recipes/cookbook.rb +1 -0
- data/lib/chef-dk/skeletons/code_generator/recipes/cookbook_file.rb +1 -0
- data/lib/chef-dk/skeletons/code_generator/recipes/helpers.rb +21 -0
- data/lib/chef-dk/skeletons/code_generator/recipes/policyfile.rb +1 -0
- data/lib/chef-dk/skeletons/code_generator/recipes/recipe.rb +1 -0
- data/lib/chef-dk/skeletons/code_generator/recipes/repo.rb +1 -0
- data/lib/chef-dk/skeletons/code_generator/recipes/{lwrp.rb → resource.rb} +1 -11
- data/lib/chef-dk/skeletons/code_generator/recipes/template.rb +3 -3
- data/lib/chef-dk/skeletons/code_generator/templates/default/helpers.rb.erb +39 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/metadata.rb.erb +1 -1
- data/lib/chef-dk/skeletons/code_generator/templates/default/resource.rb.erb +1 -0
- data/lib/chef-dk/version.rb +2 -2
- data/omnibus_overrides.rb +14 -12
- data/spec/unit/command/generator_commands/cookbook_spec.rb +7 -1
- data/spec/unit/command/generator_commands/helpers_spec.rb +31 -0
- data/spec/unit/command/generator_commands/{lwrp_spec.rb → resource_spec.rb} +5 -5
- data/spec/unit/command/install_spec.rb +2 -2
- data/spec/unit/command/update_spec.rb +11 -3
- data/spec/unit/command/verify_spec.rb +2 -1
- data/spec/unit/policyfile/artifactory_cookbook_source_spec.rb +59 -0
- data/spec/unit/policyfile/read_cookbook_for_compat_mode_upload_spec.rb +1 -1
- data/spec/unit/policyfile/solution_dependencies_spec.rb +25 -0
- data/spec/unit/policyfile_demands_spec.rb +2 -1
- data/spec/unit/policyfile_lock_build_spec.rb +23 -21
- data/spec/unit/policyfile_lock_install_spec.rb +2 -2
- data/spec/unit/policyfile_lock_validation_spec.rb +3 -3
- data/spec/unit/policyfile_services/export_repo_spec.rb +6 -6
- data/spec/unit/policyfile_services/install_spec.rb +1 -1
- data/spec/unit/policyfile_services/update_spec.rb +143 -0
- data/tasks/announce.rb +3 -2
- data/tasks/dependencies.rb +35 -111
- data/tasks/github_changelog_generator.rb +0 -3
- data/tasks/templates/prerelease.md.erb +1 -1
- data/tasks/templates/release.md.erb +1 -1
- metadata +20 -38
- data/lib/chef-dk/skeletons/code_generator/templates/default/provider.rb.erb +0 -0
- data/spec/unit/gemfile_util_spec.rb +0 -41
- data/spec/unit/helpers_spec.rb +0 -120
- data/spec/unit/tasks/helpers_spec.rb +0 -75
- data/tasks/bin/bundle-platform +0 -19
- data/tasks/bin/create-override-gemfile +0 -110
- data/tasks/bundle.rb +0 -96
- data/tasks/bundle_util.rb +0 -110
- data/tasks/gemfile_util.rb +0 -435
- data/tasks/helpers.rb +0 -47
- data/version_policy.rb +0 -142
data/tasks/helpers.rb
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright:: Copyright (c) 2016 Chef Software Inc.
|
3
|
-
# License:: Apache License, Version 2.0
|
4
|
-
#
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
-
# you may not use this file except in compliance with the License.
|
7
|
-
# You may obtain a copy of the License at
|
8
|
-
#
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
#
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
# See the License for the specific language governing permissions and
|
15
|
-
# limitations under the License.
|
16
|
-
#
|
17
|
-
|
18
|
-
# Putting this method in a module so it is easier to test
|
19
|
-
module RakeDependenciesTaskHelpers
|
20
|
-
def update_gemfile_from_stable(gemfile, product_name, gemfile_name, version_prefix = "")
|
21
|
-
version = get_latest_version_for(product_name)
|
22
|
-
version = "#{version_prefix}#{version}"
|
23
|
-
found = gemfile.sub!(/^(\s*gem "#{gemfile_name}", github: "chef\/#{gemfile_name}", branch: ")([^"]*)(")$/m) do
|
24
|
-
if $2 != "#{version}"
|
25
|
-
puts "Setting #{product_name} version in Gemfile to #{version} (was #{$2})"
|
26
|
-
else
|
27
|
-
puts "#{product_name} version in Gemfile already at latest stable (#{$2})"
|
28
|
-
end
|
29
|
-
"#{$1}#{version}#{$3}"
|
30
|
-
end
|
31
|
-
unless found
|
32
|
-
raise "Gemfile does not have a line of the form 'gem \"#{gemfile_name}\", github: \"chef/#{gemfile_name}\", branch: \"<version>\"', so we didn't update it to latest stable (#{version})."
|
33
|
-
end
|
34
|
-
gemfile
|
35
|
-
end
|
36
|
-
|
37
|
-
def get_latest_version_for(product_name, channel_name = :stable)
|
38
|
-
require "mixlib/install"
|
39
|
-
puts "Getting latest '#{channel_name}' channel #{product_name} version ..."
|
40
|
-
options = {
|
41
|
-
channel: channel_name.to_sym,
|
42
|
-
product_version: :latest,
|
43
|
-
product_name: product_name,
|
44
|
-
}
|
45
|
-
Mixlib::Install.new(options).artifact_info.first.version
|
46
|
-
end
|
47
|
-
end
|
data/version_policy.rb
DELETED
@@ -1,142 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright:: Copyright (c) 2016-2017, Chef Software Inc.
|
3
|
-
# License:: Apache License, Version 2.0
|
4
|
-
#
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
-
# you may not use this file except in compliance with the License.
|
7
|
-
# You may obtain a copy of the License at
|
8
|
-
#
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
#
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
# See the License for the specific language governing permissions and
|
15
|
-
# limitations under the License.
|
16
|
-
#
|
17
|
-
|
18
|
-
# Explicit omnibus overrides.
|
19
|
-
OMNIBUS_OVERRIDES = {
|
20
|
-
:bundler => "1.16.0",
|
21
|
-
:rubygems => "2.6.14",
|
22
|
-
# Lower level library pins
|
23
|
-
# These are the latest version in omnibus-software as of 2017-11-28:
|
24
|
-
"libffi" => "3.2.1",
|
25
|
-
"libiconv" => "1.15",
|
26
|
-
"liblzma" => "5.2.3",
|
27
|
-
"libxml2" => "2.9.5",
|
28
|
-
"libxslt" => "1.1.30",
|
29
|
-
"libyaml" => "0.1.7",
|
30
|
-
"makedepend" => "1.0.5",
|
31
|
-
"ncurses" => "5.9",
|
32
|
-
"openssl" => "1.0.2m",
|
33
|
-
"pkg-config-lite" => "0.28-1",
|
34
|
-
"ruby" => "2.3.5",
|
35
|
-
"util-macros" => "1.19.0",
|
36
|
-
"xproto" => "7.0.28",
|
37
|
-
"zlib" => "1.2.11",
|
38
|
-
## according to comment in omnibus-sw, the latest versions of libtool don't work on solaris
|
39
|
-
# https://github.com/chef/omnibus-software/blob/aefb7e79d29ca746c3f843673ef5e317fa3cba54/config/software/libtool.rb#L23
|
40
|
-
"libtool" => "2.4.2",
|
41
|
-
# Leave dev-kit pinned to 4.5 on 32-bit, because 4.7 is 20MB larger and we don't want
|
42
|
-
# to unnecessarily make the client any fatter. (Since it's different between
|
43
|
-
# 32 and 64, we have to do it in the project file still.)
|
44
|
-
# "ruby-windows-devkit" => "4.5.2-20111229-1559",
|
45
|
-
"ruby-windows-devkit-bash" => "3.1.23-4-msys-1.0.18",
|
46
|
-
# The windows dependency (libzmq4x-windows) only has 1 version so far in
|
47
|
-
# software def so we don't need to override that
|
48
|
-
"libzmq" => "4.0.7",
|
49
|
-
}
|
50
|
-
|
51
|
-
#
|
52
|
-
# rake dependencies:update_omnibus_overrides (tasks/dependencies.rb) reads this
|
53
|
-
# and modifies omnibus_overrides.rb
|
54
|
-
#
|
55
|
-
# The left side is the software definition name, and the right side is the
|
56
|
-
# name of the rubygem (gem list -re <rubygem name> gets us the latest version).
|
57
|
-
#
|
58
|
-
OMNIBUS_RUBYGEMS_AT_LATEST_VERSION = {
|
59
|
-
# rubygems: "rubygems-update",
|
60
|
-
# bundler: "bundler", # pinned to 1.12.5 until we figure out how we're failing on 1.13.0
|
61
|
-
}
|
62
|
-
|
63
|
-
#
|
64
|
-
# rake dependencies:check (tasks/dependencies.rb) uses this as a list of gems
|
65
|
-
# that are allowed to be outdated according to `bundle updated`
|
66
|
-
#
|
67
|
-
# Once you decide that the list of outdated gems is OK, you can just
|
68
|
-
# add gems to the output of bundle outdated here and we'll parse it to get the
|
69
|
-
# list of outdated gems.
|
70
|
-
#
|
71
|
-
ACCEPTABLE_OUTDATED_GEMS = [
|
72
|
-
"activesupport", # anchored by outdated google-api-client
|
73
|
-
"celluloid", # ridley requires 0.16.x
|
74
|
-
"celluloid-io", # ridley requires 0.16.x
|
75
|
-
"cucumber-core", # Until cucumber 2.0
|
76
|
-
"fog-cloudatcost", # fog restricts this for probably no good reason
|
77
|
-
"fog-dynect", # fog restricts this for probably no good reason
|
78
|
-
"fog-google", # fog-google 0.2+ requires Ruby 2.0+, fog 2.0.0 will include it
|
79
|
-
"google-api-client", # chef-provisioning-fog restricts to < 0.9 for presently unknown reasons
|
80
|
-
"json", # inspec pins this because Ruby 2.0, no eta on fix
|
81
|
-
"rbvmomi", # fog-vsphere restricts this to a patch version, not sure why
|
82
|
-
"retriable", # anchored by outdated google-api-client
|
83
|
-
"rubocop", # cookstyle pins older releases by design
|
84
|
-
"slop", # expected to disappear with pry 0.11
|
85
|
-
"timers", # anchored by outdated celluloid
|
86
|
-
"github_changelog_generator", # we use a forked version that differs from rubygems
|
87
|
-
"addressable", # sawyer limits to < 2.6
|
88
|
-
"faraday", # ridely restrcits this 0.9.x
|
89
|
-
"thor", # berkshelf restricts this to < 0.19.2
|
90
|
-
"nokogiri", # fog limits to ~> 1.5
|
91
|
-
"mixlib-install", # test kitchen limits to less than 3.x
|
92
|
-
|
93
|
-
# We have a task called update_stable_channel_gems which scans and pins to the
|
94
|
-
# latest released chef/chef-config/opscode-pushy-client but it pulls from the
|
95
|
-
# chef repo instead of from rubygems. Bundler currently considers any git
|
96
|
-
# source at the same version (or lower) than one available from rubygems as
|
97
|
-
# outdated and hence fails the outdated gem test, confusing Julia bot.
|
98
|
-
|
99
|
-
# Therefore.. turn checks on both of them off. If and when the rake task for
|
100
|
-
# update_stable_channel_gems changes, this exclusion can be revisited.
|
101
|
-
"chef",
|
102
|
-
"chef-config",
|
103
|
-
"opscode-pushy-client",
|
104
|
-
"mixlib-cli",
|
105
|
-
|
106
|
-
]
|
107
|
-
|
108
|
-
#
|
109
|
-
# Some gems are part of our bundle (must be installed) but not important
|
110
|
-
# enough to lock. We allow `bundle install` in test-kitchen, berks, etc.
|
111
|
-
# to use their own versions of these.
|
112
|
-
#
|
113
|
-
# This mainly tells you which gems `chef verify` allows you to install and
|
114
|
-
# run.
|
115
|
-
#
|
116
|
-
GEMS_ALLOWED_TO_FLOAT = [
|
117
|
-
"rubocop", # different projects disagree in their dev dependencies
|
118
|
-
"unicode-display_width", # dep of rubocop
|
119
|
-
"powerpack", # dep of rubocop
|
120
|
-
"cookstyle", # has a runtime dep on rubocop
|
121
|
-
]
|
122
|
-
|
123
|
-
#
|
124
|
-
# The list of groups we install without: this drives both the `bundle install`
|
125
|
-
# we do in chef-dk, and the `bundle check` we do to ensure installed gems dont
|
126
|
-
# have extra deps hiding in their Gemfiles.
|
127
|
-
#
|
128
|
-
INSTALL_WITHOUT_GROUPS = %w{
|
129
|
-
changelog
|
130
|
-
compat_testing
|
131
|
-
deploy
|
132
|
-
development
|
133
|
-
docgen
|
134
|
-
guard
|
135
|
-
integration
|
136
|
-
maintenance
|
137
|
-
test
|
138
|
-
tools
|
139
|
-
travis
|
140
|
-
style
|
141
|
-
simulator
|
142
|
-
}
|