chef 12.9.41-universal-mingw32 → 12.10.24-universal-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +52 -13
  3. data/README.md +145 -0
  4. data/Rakefile +4 -14
  5. data/VERSION +1 -1
  6. data/acceptance/.gitignore +0 -1
  7. data/acceptance/Gemfile +2 -2
  8. data/acceptance/Gemfile.lock +235 -0
  9. data/acceptance/fips/.kitchen.yml +5 -1
  10. data/acceptance/fips/test/integration/{fips → fips-integration}/serverspec/Gemfile +0 -0
  11. data/acceptance/fips/test/integration/fips-integration/serverspec/fips-integration_spec.rb +51 -0
  12. data/acceptance/fips/test/integration/fips-unit-functional/serverspec/Gemfile +3 -0
  13. data/acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb +56 -0
  14. data/{chef-windows.gemspec → chef-universal-mingw32.gemspec} +0 -0
  15. data/chef.gemspec +0 -6
  16. data/{lib → lib-backcompat}/chef/chef_fs/file_system/already_exists_error.rb +0 -0
  17. data/{lib → lib-backcompat}/chef/chef_fs/file_system/cookbook_frozen_error.rb +0 -0
  18. data/{lib → lib-backcompat}/chef/chef_fs/file_system/default_environment_cannot_be_modified_error.rb +0 -0
  19. data/{lib → lib-backcompat}/chef/chef_fs/file_system/file_system_error.rb +0 -0
  20. data/{lib → lib-backcompat}/chef/chef_fs/file_system/must_delete_recursively_error.rb +0 -0
  21. data/{lib → lib-backcompat}/chef/chef_fs/file_system/not_found_error.rb +0 -0
  22. data/{lib → lib-backcompat}/chef/chef_fs/file_system/operation_failed_error.rb +0 -0
  23. data/{lib → lib-backcompat}/chef/chef_fs/file_system/operation_not_allowed_error.rb +0 -0
  24. data/lib-backcompat/chef/chef_fs/file_system/repository/chef_repository_file_system_acls_dir.rb +5 -0
  25. data/lib-backcompat/chef/chef_fs/file_system/repository/chef_repository_file_system_client_keys_dir.rb +5 -0
  26. data/lib-backcompat/chef/chef_fs/file_system/repository/chef_repository_file_system_entry.rb +6 -0
  27. data/lib-backcompat/chef/chef_fs/file_system/repository/chef_repository_file_system_policies_dir.rb +5 -0
  28. data/{lib → lib-backcompat}/chef/chef_fs/file_system/repository/file_system_root_dir.rb +1 -0
  29. data/lib/chef/chef_fs/file_system/repository/acl.rb +38 -0
  30. data/lib/chef/chef_fs/file_system/repository/{chef_repository_file_system_acls_dir.rb → acls_dir.rb} +14 -5
  31. data/lib/chef/chef_fs/file_system/repository/acls_sub_dir.rb +42 -0
  32. data/lib/chef/chef_fs/file_system/repository/base_file.rb +120 -0
  33. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb +1 -1
  34. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb +36 -32
  35. data/lib/chef/chef_fs/file_system/repository/client.rb +38 -0
  36. data/lib/chef/chef_fs/file_system/repository/client_key.rb +38 -0
  37. data/lib/chef/chef_fs/file_system/repository/{chef_repository_file_system_client_keys_dir.rb → client_keys_dir.rb} +9 -5
  38. data/lib/chef/chef_fs/file_system/repository/client_keys_sub_dir.rb +42 -0
  39. data/lib/chef/chef_fs/file_system/repository/clients_dir.rb +40 -0
  40. data/lib/chef/chef_fs/file_system/repository/container.rb +38 -0
  41. data/lib/chef/chef_fs/file_system/repository/containers_dir.rb +41 -0
  42. data/lib/chef/chef_fs/file_system/repository/cookbooks_dir.rb +0 -1
  43. data/lib/chef/chef_fs/file_system/repository/data_bag_item.rb +3 -79
  44. data/lib/chef/chef_fs/file_system/repository/directory.rb +15 -2
  45. data/lib/chef/chef_fs/file_system/repository/environment.rb +38 -0
  46. data/lib/chef/chef_fs/file_system/repository/environments_dir.rb +41 -0
  47. data/lib/chef/chef_fs/file_system/repository/file_system_entry.rb +66 -30
  48. data/lib/chef/chef_fs/file_system/repository/group.rb +38 -0
  49. data/lib/chef/chef_fs/file_system/repository/groups_dir.rb +41 -0
  50. data/lib/chef/chef_fs/file_system/repository/node.rb +38 -0
  51. data/lib/chef/chef_fs/file_system/repository/nodes_dir.rb +41 -0
  52. data/lib/chef/chef_fs/file_system/repository/{chef_repository_file_system_policies_dir.rb → policies_dir.rb} +9 -5
  53. data/lib/chef/chef_fs/file_system/repository/policy.rb +38 -0
  54. data/lib/chef/chef_fs/file_system/repository/policy_group.rb +38 -0
  55. data/lib/chef/chef_fs/file_system/repository/policy_groups_dir.rb +41 -0
  56. data/lib/chef/chef_fs/file_system/repository/role.rb +38 -0
  57. data/lib/chef/chef_fs/file_system/repository/roles_dir.rb +41 -0
  58. data/lib/chef/chef_fs/file_system/repository/user.rb +38 -0
  59. data/lib/chef/chef_fs/file_system/repository/users_dir.rb +41 -0
  60. data/lib/chef/dsl/declare_resource.rb +182 -7
  61. data/lib/chef/http/json_input.rb +2 -2
  62. data/lib/chef/knife.rb +1 -1
  63. data/lib/chef/mixin/shell_out.rb +10 -21
  64. data/lib/chef/property.rb +9 -2
  65. data/lib/chef/provider.rb +8 -7
  66. data/lib/chef/provider/apt_repository.rb +8 -6
  67. data/lib/chef/provider/directory.rb +15 -1
  68. data/lib/chef/provider/env/windows.rb +1 -1
  69. data/lib/chef/provider/mdadm.rb +1 -0
  70. data/lib/chef/provider/package/easy_install.rb +2 -0
  71. data/lib/chef/provider/package/rubygems.rb +4 -1
  72. data/lib/chef/provider/package/windows.rb +1 -1
  73. data/lib/chef/recipe.rb +1 -2
  74. data/lib/chef/resource/apt_repository.rb +6 -6
  75. data/lib/chef/resource/mdadm.rb +9 -0
  76. data/lib/chef/resource_collection.rb +5 -0
  77. data/lib/chef/resource_collection/resource_list.rb +10 -0
  78. data/lib/chef/resource_collection/resource_set.rb +14 -11
  79. data/lib/chef/version.rb +1 -1
  80. data/spec/functional/resource/git_spec.rb +1 -3
  81. data/spec/functional/resource/group_spec.rb +5 -5
  82. data/spec/functional/tiny_server_spec.rb +1 -1
  83. data/spec/functional/util/powershell/cmdlet_spec.rb +1 -1
  84. data/spec/functional/win32/registry_spec.rb +3 -3
  85. data/spec/integration/solo/solo_spec.rb +2 -2
  86. data/spec/support/shared/functional/securable_resource.rb +1 -1
  87. data/spec/support/shared/unit/provider/file.rb +3 -3
  88. data/spec/support/shared/unit/windows_script_resource.rb +1 -1
  89. data/spec/unit/application/apply_spec.rb +1 -0
  90. data/spec/unit/chef_fs/file_system/repository/base_file_spec.rb +128 -0
  91. data/spec/unit/chef_fs/file_system/repository/directory_spec.rb +174 -0
  92. data/spec/unit/cookbook/metadata_spec.rb +1 -1
  93. data/spec/unit/dsl/declare_resource_spec.rb +335 -0
  94. data/spec/unit/knife/bootstrap_spec.rb +2 -2
  95. data/spec/unit/mixin/shell_out_spec.rb +4 -0
  96. data/spec/unit/node/attribute_spec.rb +1 -1
  97. data/spec/unit/node/immutable_collections_spec.rb +2 -2
  98. data/spec/unit/node_map_spec.rb +1 -1
  99. data/spec/unit/property/validation_spec.rb +23 -7
  100. data/spec/unit/provider/apt_repository_spec.rb +5 -0
  101. data/spec/unit/provider/apt_update_spec.rb +1 -0
  102. data/spec/unit/provider/directory_spec.rb +0 -7
  103. data/spec/unit/provider/file/content_spec.rb +1 -1
  104. data/spec/unit/provider/mdadm_spec.rb +9 -0
  105. data/spec/unit/provider/package/easy_install_spec.rb +6 -0
  106. data/spec/unit/provider/package/rubygems_spec.rb +8 -4
  107. data/spec/unit/provider/package/yum_spec.rb +1 -1
  108. data/spec/unit/provider/powershell_script_spec.rb +1 -1
  109. data/spec/unit/provider/user/dscl_spec.rb +6 -6
  110. data/spec/unit/recipe_spec.rb +1 -0
  111. data/spec/unit/resource/apt_repository_spec.rb +4 -0
  112. data/spec/unit/resource/file/verification_spec.rb +1 -1
  113. data/spec/unit/resource/file_spec.rb +2 -2
  114. data/spec/unit/resource/mdadm_spec.rb +7 -2
  115. data/spec/unit/resource_collection_spec.rb +30 -0
  116. data/spec/unit/resource_spec.rb +1 -1
  117. data/tasks/bin/bundle-platform +15 -0
  118. data/tasks/bin/bundle-platform.bat +2 -0
  119. data/tasks/bin/create-override-gemfile +110 -0
  120. data/tasks/bin/run_chef_tests +17 -0
  121. data/tasks/bin/run_external_test +47 -0
  122. data/tasks/bundle.rb +97 -0
  123. data/tasks/bundle_util.rb +94 -0
  124. data/tasks/changelog.rb +12 -0
  125. data/tasks/dependencies.rb +147 -0
  126. data/tasks/gemfile_util.rb +390 -0
  127. data/tasks/maintainers.rb +2 -1
  128. data/tasks/rspec.rb +2 -1
  129. metadata +61 -83
  130. data/acceptance/fips/test/integration/fips/serverspec/fips_spec.rb +0 -39
  131. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_entry.rb +0 -83
  132. data/tasks/external_tests.rb +0 -64
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 34297baa69643e5349193e383ef532d46eba2775
4
- data.tar.gz: 5a8188747d28b0fe7fa7836363c3eb430b71e777
3
+ metadata.gz: 33d4c61c44d1e4112b842560b4a77e6c29b5aeef
4
+ data.tar.gz: 2e74e2e16e19bc1aec21eadd3779c036b2c73e7b
5
5
  SHA512:
6
- metadata.gz: c83565eb3006d8e0d1996fdff4d04fb12faa7b07f3810c0e4c72b913e1b33f9aa99b2c37e2f3b5601e3ae335f8e2ce63d04e2aa90a3e93ae2403a3cd6179c6b8
7
- data.tar.gz: 448a3f167442847534e6cbf2b31c937a96287299c44aedb84df357560c377da6c85d2adc296b59c019a6fe98b02b30b3e4e9658ffcf997e6e72e90c5ed2745d0
6
+ metadata.gz: 8e652a9c17ea39430fdb6b2fb2b0cfd66fa959b13c8924e1ec7efa8ed4cb0050ddd67a349dc40345f665493fc391d3360b797e05c72ac73ce56fefae87d9342b
7
+ data.tar.gz: 08a0feb2d30e779129057756955e0f34c7d88dff8edf1e1c57ebefe7d4d937e5d97ee6d553252ad384a8f86d8636a3493858c9c25a1421e1c2413ecd8eeb27a1
data/Gemfile CHANGED
@@ -1,12 +1,50 @@
1
- source "https://rubygems.org"
2
- gemspec name: "chef"
1
+ # This buys us the ability to be included in other Gemfiles
2
+ require_relative "tasks/gemfile_util"
3
+ extend GemfileUtil
3
4
 
4
- gem "activesupport", "< 4.0.0", group: :compat_testing, platform: "ruby"
5
+ source "https://rubygems.org"
5
6
 
6
- gem "chef-config", path: "chef-config" if File.exist?(File.expand_path("../chef-config", __FILE__))
7
+ # Pick the gemspec for our platform
8
+ gemspec_name = "chef"
9
+ Dir.glob("chef-*.gemspec").each do |gemspec_filename|
10
+ gemspec_filename =~ /^chef-(.+).gemspec/
11
+ gemspec_platform = $1
12
+ if Gem::Platform.match(Gem::Platform.new(gemspec_platform))
13
+ Bundler.ui.info "Using gemspec #{gemspec_filename} for current platform."
14
+ gemspec_name = "chef-#{gemspec_platform}"
15
+ end
16
+ end
17
+ gemspec name: gemspec_name
7
18
 
19
+ gem "chef-config", path: File.expand_path("../chef-config", __FILE__) if File.exist?(File.expand_path("../chef-config", __FILE__))
8
20
  # Ensure that we can always install rake, regardless of gem groups
9
21
  gem "rake"
22
+ gem "bundler"
23
+ gem "cheffish"
24
+
25
+ group(:omnibus_package) do
26
+ gem "appbundler"
27
+ gem "rb-readline"
28
+ gem "nokogiri"
29
+ end
30
+ group(:omnibus_package, :pry) do
31
+ gem "pry"
32
+ gem "pry-byebug"
33
+ gem "pry-remote"
34
+ gem "pry-stack_explorer"
35
+ end
36
+ # These are used for external tests
37
+ group(:integration) do
38
+ gem "chef-provisioning"
39
+ gem "chef-provisioning-aws"
40
+ gem "chef-rewind"
41
+ gem "chef-sugar"
42
+ gem "chefspec"
43
+ gem "halite"
44
+ gem "poise"
45
+ gem "knife-windows"
46
+ gem "foodcritic"
47
+ end
10
48
 
11
49
  group(:docgen) do
12
50
  gem "yard"
@@ -20,26 +58,27 @@ group(:maintenance) do
20
58
  gem "netrc"
21
59
  end
22
60
 
23
- group(:pry) do
24
- gem "pry"
25
- gem "pry-byebug"
26
- gem "pry-stack_explorer"
27
- end
28
-
29
- group(:ruby_prof) do
61
+ # Everything except AIX
62
+ group(:linux, :bsd, :mac_os_x, :solaris, :windows) do
30
63
  # may need to disable this in insolation on fussy builds like AIX, RHEL4, etc
31
64
  gem "ruby-prof"
32
65
  end
66
+ # Everything except AIX and Windows
67
+ group(:linux, :bsd, :mac_os_x, :solaris) do
68
+ gem "ruby-shadow", platforms: :ruby
69
+ end
33
70
 
34
71
  group(:development, :test) do
35
72
  gem "simplecov"
36
- gem "rack", "~> 1.5.1"
73
+ gem "rack"
37
74
 
38
75
  # for testing new chefstyle rules
39
76
  # gem 'chefstyle', github: 'chef/chefstyle'
40
77
  gem "chefstyle", git: "https://github.com/chef/chefstyle.git", branch: "master"
78
+ end
41
79
 
42
- gem "ruby-shadow", platforms: :ruby unless RUBY_PLATFORM.downcase =~ /(aix|cygwin)/
80
+ group(:changelog) do
81
+ gem "github_changelog_generator"
43
82
  end
44
83
 
45
84
  group(:travis) do
data/README.md CHANGED
@@ -116,6 +116,151 @@ tests in spec/functional/ and spec/unit/ respectively. These will be run on Ubun
116
116
  through Travis CI, and on Windows through AppVeyor. The status of these runs will
117
117
  be displayed with your pull request.
118
118
 
119
+ ## Building the Full Package
120
+
121
+ To build chef as a standalone package (with ruby and all dependent libraries included in a .deb, .rpm, .pkg or .msi), we use the omnibus system. Go to the [omnibus README](omnibus/README.md) to find out how to build!
122
+
123
+ ## Updating Dependencies
124
+
125
+ If you want to change our constraints (change which packages and versions we accept in the chef), there are several places to do so:
126
+
127
+ * To add or remove a gem from chef, or update a gem version, edit [Gemfile](Gemfile).
128
+ * To change the version of binary packages, edit [version_policy.rb](version_policy.rb).
129
+ * To add new packages to chef, edit [omnibus/config/projects/chef.rb](omnibus/config/projects/chef.rb).
130
+
131
+ Once you've made any changes you want, you have to update the lockfiles that actually drive the build:
132
+ * To update chef's gem dependencies to the very latest versions available, run `rake bundle:update`.
133
+ * To update chef's gem dependencies *conservatively* (changing as little as possible), run `rake bundle:install`.
134
+ * To update specific gems only, run `rake bundle:update[gem1 gem2 ...]`
135
+ * **`bundle update` and `bundle install` will *not* work, on purpose:** the rake task handles both the windows and non-windows lockfiles and updates them in sync.
136
+
137
+ To perform a full update of all dependencies in chef (including binary packages, tests and build system dependencies), run `rake dependencies`. This will update the `Gemfile.lock`, `omnibus/Gemfile.lock`, `acceptance/Gemfile.lock`, `omnibus/Berksfile.lock`, and `omnibus_overrides.rb`. It will also show you any outdated dependencies due to conflicting constraints. Some outdated dependencies are to be expected; it will inform you if any new ones appear that we don't know about, and tell you how to proceed.
138
+
139
+ # How Chef Builds and Versions
140
+
141
+ Chef is an amalgam of many components. These components update all the time, necessitating new builds. This is an overview of the process of versioning, building and releasing Chef.
142
+
143
+ ## Chef Packages
144
+
145
+ Chef is distributed as packages for debian, rhel, ubuntu, windows and os/x. It includes a large number of components from various sources, and these are versioned and maintained separately from chef project, which bundles them all together conveniently for the user.
146
+
147
+ These packages go through several milestones:
148
+ - `master`: When code is checked in to master, the patch version of chef is bumped (e.g. 0.9.10 -> 0.9.11) and a build is kicked off automatically to create and test the packages in Chef's Jenkins cluster.
149
+ - `unstable`: When a package is built, it enters the unstable channel. When all packages for all OS's have successfully built, the test phase is kicked off in Jenkins across all supported OS's. These builds are password-protected and generally only available to the test systems.
150
+ - `current`: If the packages pass all the tests on all supported OS's, it is promoted as a unit to `current`, and is available via Chef's artifactory by running `curl https://omnitruck.chef.io/install.sh | sudo bash -s -- -c current -P chef`
151
+ - `stable`: Periodically, Chef will pick a release to "bless" for folks who would like a slower update schedule than "every time a build passes the tests." When this happens, it is manually promoted to stable and an announcement is sent to the list. It can be reached at https://downloads.chef.io or installed using the `curl` command without specifying `-c current`. Packages in `stable` are no longer available in `current`.
152
+
153
+ Additionally, periodically Chef will update the desired versions of chef components and check that in to `master`, triggering a new build with the updated components in it.
154
+
155
+ ## Automated Version Bumping
156
+
157
+ Whenever a change is checked in to `master`, the patch version of `chef` is bumped. To do this, the `lita-versioner` bot listens to github for merged PRs, and when it finds one, takes these actions:
158
+
159
+ 1. Bumps the patch version in `lib/chef/version.rb` (e.g. 0.9.14 -> 0.9.15).
160
+ 2. Runs `rake dependencies:update_conservative` to update the `Gemfile.lock` to include the new version.
161
+ 3. Pushes to `master` and submits a new build to Chef's Jenkins cluster.
162
+
163
+ ## Component Versions
164
+
165
+ Chef has two sorts of component: ruby components like `berkshelf` and `test-kitchen`, and binary components like `openssl` and even `ruby` itself.
166
+
167
+ In general, you can find all chef desired versions in the [Gemfile](Gemfile) and [version_policy.rb](version_policy.rb) files. The [Gemfile.lock](Gemfile.lock) is the locked version of the Gemfile, and [omnibus_overrides](omnibus_overrides.rb) is the locked version of omnibus. [build](omnibus/Gemfile) and [test](acceptance/Gemfile) Gemfiles and [Berksfile](omnibus/Berksfile) version the toolset we use to build and test.
168
+
169
+ ### Binary Components
170
+
171
+ The versions of binary components (as well as rubygems and bundler, which can't be versioned in a Gemfile) are stored in [version_policy.rb](version_policy.rb) (the `OMNIBUS_OVERRIDES` constant) and locked in [omnibus_overrides](omnibus_overrides.rb). `rake dependencies` will update the `bundler` version, and the rest are be updated manually by Chef every so often.
172
+
173
+ These have software definitions either in [omnibus/config/software](omnibus/config/software) or, more often, in the [omnibus-software](https://github.com/chef/omnibus-software/tree/master/config/software) project.
174
+
175
+ ### Rubygems Components
176
+
177
+ Most of the actual front-facing software in chef is composed of ruby projects. berkshelf, test-kitchen and even chef itself are made of ruby gems. Chef uses the typical ruby way of controlling rubygems versions, the `Gemfile`. Specifically, the `Gemfile` at the top of chef repository governs the version of every single gem we install into chef package. It's a one-stop shop.
178
+
179
+ Our rubygems component versions are locked down with `Gemfile.lock`, and can be updated with `rake dependencies`.
180
+
181
+ There are three gems versioned outside the `Gemfile`: `rubygems`, `bundler` and `chef`. `rubygems` and `bundler` are in the `RUBYGEMS_AT_LATEST_VERSION` constant in [version_policy.rb](version-policy.rb) and locked in [omnibus_overrides](omnibus_overrides.rb). They are kept up to date by `rake dependencies`.
182
+
183
+ **Windows**: [Gemfile.lock](Gemfile.lock) is generated platform-agnostic, and then generated again for Windows. The one file has the solution for both Linux and Windows.
184
+
185
+ The tool we use to generate Windows-specific lockfiles on non-Windows machines is [tasks/bin/bundle-platform](bundle-platform), which takes the first argument and sets `Gem.platforms`, and then calls `bundle` with the remaining arguments.
186
+
187
+ ### Build Tooling Versions
188
+
189
+ Of special mention is the software we use to build omnibus itself. There are two distinct bits of code that control the versions of compilers, make, git, and other tools we use to build.
190
+
191
+ First, the Jenkins machines that run the build are configured entirely by the [opscode-ci cookbook](https://github.com/chef-cookbooks/opscode-ci) cookbook. They install most of the tools we use via `build-essentials`, and standardize the build environment so we can tear down and bring up builders at will. These machines are kept alive long-running, are periodically updated by Chef to the latest opscode-ci, omnibus and build-essentials cookbooks.
192
+
193
+ Second, the version of omnibus we use to build chef is governed by `omnibus/Gemfile`. When software definitions or the omnibus framework is updated, this is the file that drives whether we pick it up.
194
+
195
+ The omnibus tooling versions are locked down with `omnibus/Gemfile.lock`, and can be updated by running `rake dependencies`.
196
+
197
+ ### Test Versions
198
+
199
+ chef is tested by the [chef-acceptance framework](https://github.com/chef/chef-acceptance), which contains suites that are run on the Jenkins test machines. The definitions of the tests are in the `acceptance` directory. The version of chef-acceptance and test-kitchen, are governed by `acceptance/Gemfile`.
200
+
201
+ The test tooling versions are locked down with `acceptance/Gemfile.lock`, which can be updated by running `rake dependencies`.
202
+
203
+ ## The Build Process
204
+
205
+ The actual Chef build process is done with Omnibus, and has several general steps:
206
+
207
+ 1. `bundle install` from `chef/Gemfile.lock`
208
+ 2. Reinstall any gems that came from git or path using `rake install`
209
+ 3. appbundle chef, chef, test-kitchen and berkshelf
210
+ 4. Put miscellaneous powershell scripts and cleanup
211
+
212
+ ### Kicking Off The Build
213
+
214
+ The build is kicked off in Jenkins by running this on the machine (which is already the correct OS and already has the correct dependencies, loaded by the `omnibus` cookbook):
215
+
216
+ ```
217
+ load-omnibus-toolchain.bat
218
+ cd chef/omnibus
219
+ bundle install
220
+ bundle exec omnibus build chef
221
+ ```
222
+
223
+ This causes the [chef project definition](omnibus/config/projects/chef.rb) to load, which runs the [chef-complete](omnibus/config/software/chef-complete.rb) software definition, the primary software definition driving the whole build process. The reason we embed it all in a software definiton instead of the project is to take advantage of omnibus caching: omnibus will invalidate the entire project (and recompile ruby, openssl, and everything else) if you change anything at all in the project file. Not so with a software definition.
224
+
225
+ ### Installing the Gems
226
+
227
+ The primary build definition that installs the many Chef rubygems is [`software/chef.rb`](omnibus/software/chef.rb). This has dependencies on any binary libraries, ruby, rubygems and bundler. It has a lot of steps, so it uses a [library](omnibus/files/chef/build-chef.rb) to help reuse code and make it manageable to look at.
228
+
229
+ What it does:
230
+
231
+ 1. Depends on software defs for pre-cached gems (see "Gems and Caching" below).
232
+ 2. Installs all gems from the bundle:
233
+ - Sets up a `.bundle/config` ([code](omnibus/files/chef/build-chef.rb#L17-L39)) with --retries=4, --jobs=1, --without=development,no_<platform>, and `build.config.nokogiri` to pass.
234
+ - Sets up a common environment, standardizing the compilers and flags we use, in [`env`](omnibus/files/chef-gem/build-chef-gem.rb#L32-L54).
235
+ - [Runs](omnibus/config/software/chef.rb#L68) `bundle install --verbose`
236
+ 3. Reinstalls any gems that were installed via path:
237
+ - [Runs](omnibus/files/chef/build-chef.rb#L80) `bundle list --paths` to get the installed directories of all gems.
238
+ - For each gem not installed in the main gem dir, [runs](omnibus/files/chef/build-chef.rb#L89) `rake install` from the installed gem directory.
239
+ - [Deletes](omnibus/files/chef/build-chef.rb#L139-L143) the bundler git cache and path- and git-installed gems from the build.
240
+ 4. [Creates](omnibus/files/chef/build-chef.rb#L102-L152) `/opt/chef/Gemfile` and `/opt/chef/Gemfile.lock` with the gems that were installed in the build.
241
+
242
+ #### Gems and Caching
243
+
244
+ Some gems take a super long time to install (particularly native-compiled ones such as nokogiri and dep-selector-libgecode) and do not change version very often. In order to avoid doing this work every time, we take advantage of omnibus caching by separating out these gems into their own software definitions. [chef-gem-dep-selector-libgecode](omnibus/config/software/chef-gem-dep-selector-libgecode.rb) for example.
245
+
246
+ Each of these gems uses the `config/files/chef-gem/build-chef-gem` library to define itself. The name of the software definition itself indicates the .
247
+
248
+ We only create software definitions for long-running gems. Everything else is just installed in the [chef](omnibus/config/software/chef.rb) software definition in a big `bundle install` catchall.
249
+
250
+ Most gems we just install in the single `chef` software definition.
251
+
252
+ The first thing
253
+
254
+ ### Appbundling
255
+
256
+ After the gems are installed, we *appbundle* them in [chef-appbundle](omnibus/config/software/chef-appbundle.rb). This creates binstubs that use the bundle to pin the software .
257
+
258
+ During the process of appbundling, we update the gem's `Gemfile` to include the locks in the top level `/opt/chef/Gemfile.lock`, so we can guarantee they will never pick up things outside the build. We then run `bundle lock` to update the gem's `Gemfile.lock`, and `bundle check` to ensure all the gems are actually installed. The appbundler then uses these pins.
259
+
260
+ ### Other Cleanup
261
+
262
+ Finally, chef does several more steps including installing powershell scripts and shortcuts, and removing extra documentation to keep the build slim.
263
+
119
264
  # License
120
265
 
121
266
  Chef - A configuration management system
data/Rakefile CHANGED
@@ -24,14 +24,17 @@ require "chef/version"
24
24
  require "chef-config/package_task"
25
25
  require "rdoc/task"
26
26
  require_relative "tasks/rspec"
27
- require_relative "tasks/external_tests"
28
27
  require_relative "tasks/maintainers"
29
28
  require_relative "tasks/cbgb"
29
+ require_relative "tasks/dependencies"
30
+ require_relative "tasks/changelog"
30
31
 
31
32
  ChefConfig::PackageTask.new(File.expand_path("..", __FILE__), "Chef") do |package|
32
33
  package.component_paths = ["chef-config"]
33
34
  package.generate_version_class = true
34
35
  end
36
+ # Add a conservative dependency update to version:bump (which was created by PackageTask)
37
+ task "version:bump" => %w{version:bump_patch version:update bundle:install}
35
38
 
36
39
  task :pedant, :chef_zero_spec
37
40
 
@@ -72,16 +75,3 @@ begin
72
75
  rescue LoadError
73
76
  puts "yard is not available. (sudo) gem install yard to generate yard documentation."
74
77
  end
75
-
76
- begin
77
- require "github_changelog_generator/task"
78
-
79
- GitHubChangelogGenerator::RakeTask.new :changelog do |config|
80
- config.future_release = Chef::VERSION
81
- config.enhancement_labels = "enhancement,Enhancement,New Feature,Feature".split(",")
82
- config.bug_labels = "bug,Bug,Improvement,Upstream Bug".split(",")
83
- config.exclude_labels = "duplicate,question,invalid,wontfix,no_changelog,Exclude From Changelog,Question,Discussion".split(",")
84
- end
85
- rescue LoadError
86
- puts "github_changelog_generator is not available. gem install github_changelog_generator to generate changelogs"
87
- end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 12.9.41
1
+ 12.10.24
@@ -1,2 +1 @@
1
- /Gemfile.lock
2
1
  .acceptance_logs
@@ -2,12 +2,12 @@ source "https://rubygems.org"
2
2
 
3
3
  gem "chef-acceptance", github: "chef/chef-acceptance"
4
4
  gem "test-kitchen"
5
- gem "kitchen-ec2", github: "test-kitchen/kitchen-ec2", branch: "jk/image-search-only"
5
+ gem "kitchen-ec2"
6
6
  gem "kitchen-inspec"
7
7
  gem "inspec"
8
8
  # Pinning to github for kitchen-vagrant because 0.19.0 incorrectly
9
9
  # puts in a box_url for bento when a vagrant box in atlas is specified
10
- gem "kitchen-vagrant", github: "test-kitchen/kitchen-vagrant"
10
+ gem "kitchen-vagrant"
11
11
  gem "windows_chef_zero"
12
12
  gem "winrm-fs"
13
13
  gem "berkshelf"
@@ -0,0 +1,235 @@
1
+ GIT
2
+ remote: git://github.com/chef/chef-acceptance.git
3
+ revision: 49458ec493dbd12588680eea9f2f9beb76463d09
4
+ specs:
5
+ chef-acceptance (0.2.0)
6
+ mixlib-shellout (~> 2.0)
7
+ thor (~> 0.19)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ addressable (2.4.0)
13
+ artifactory (2.3.2)
14
+ aws-sdk (2.2.34)
15
+ aws-sdk-resources (= 2.2.34)
16
+ aws-sdk-core (2.2.34)
17
+ jmespath (~> 1.0)
18
+ aws-sdk-resources (2.2.34)
19
+ aws-sdk-core (= 2.2.34)
20
+ berkshelf (4.3.2)
21
+ addressable (~> 2.3, >= 2.3.4)
22
+ berkshelf-api-client (~> 2.0, >= 2.0.2)
23
+ buff-config (~> 1.0)
24
+ buff-extensions (~> 1.0)
25
+ buff-shell_out (~> 0.1)
26
+ celluloid (= 0.16.0)
27
+ celluloid-io (~> 0.16.1)
28
+ cleanroom (~> 1.0)
29
+ faraday (~> 0.9)
30
+ httpclient (~> 2.7)
31
+ minitar (~> 0.5, >= 0.5.4)
32
+ octokit (~> 4.0)
33
+ retryable (~> 2.0)
34
+ ridley (~> 4.5)
35
+ solve (~> 2.0)
36
+ thor (~> 0.19)
37
+ berkshelf-api-client (2.0.2)
38
+ faraday (~> 0.9.1)
39
+ httpclient (~> 2.7.0)
40
+ ridley (~> 4.5)
41
+ buff-config (1.0.1)
42
+ buff-extensions (~> 1.0)
43
+ varia_model (~> 0.4)
44
+ buff-extensions (1.0.0)
45
+ buff-ignore (1.1.1)
46
+ buff-ruby_engine (0.1.0)
47
+ buff-shell_out (0.2.0)
48
+ buff-ruby_engine (~> 0.1.0)
49
+ builder (3.2.2)
50
+ celluloid (0.16.0)
51
+ timers (~> 4.0.0)
52
+ celluloid-io (0.16.2)
53
+ celluloid (>= 0.16.0)
54
+ nio4r (>= 1.1.0)
55
+ chef-config (12.9.38)
56
+ fuzzyurl (~> 0.8.0)
57
+ mixlib-config (~> 2.0)
58
+ mixlib-shellout (~> 2.0)
59
+ cleanroom (1.0.0)
60
+ coderay (1.1.1)
61
+ diff-lcs (1.2.5)
62
+ docker-api (1.26.2)
63
+ excon (>= 0.38.0)
64
+ json
65
+ erubis (2.7.0)
66
+ excon (0.49.0)
67
+ faraday (0.9.2)
68
+ multipart-post (>= 1.2, < 3)
69
+ ffi (1.9.10)
70
+ fuzzyurl (0.8.0)
71
+ gssapi (1.2.0)
72
+ ffi (>= 1.0.1)
73
+ gyoku (1.3.1)
74
+ builder (>= 2.1.2)
75
+ hashie (3.4.3)
76
+ hitimes (1.2.3)
77
+ httpclient (2.7.1)
78
+ inspec (0.19.1)
79
+ json (~> 1.8)
80
+ method_source (~> 0.8)
81
+ pry (~> 0)
82
+ r-train (~> 0.10.5)
83
+ rainbow (~> 2)
84
+ rspec (~> 3)
85
+ rspec-its (~> 1.2)
86
+ rubyzip (~> 1.1)
87
+ thor (~> 0.19)
88
+ jmespath (1.2.4)
89
+ json_pure (>= 1.8.1)
90
+ json (1.8.3)
91
+ json_pure (1.8.3)
92
+ kitchen-ec2 (1.0.0)
93
+ aws-sdk (~> 2)
94
+ excon
95
+ multi_json
96
+ retryable (~> 2.0)
97
+ test-kitchen (~> 1.4, >= 1.4.1)
98
+ kitchen-inspec (0.12.5)
99
+ inspec (>= 0.14.1, < 1.0.0)
100
+ test-kitchen (~> 1.6)
101
+ kitchen-vagrant (0.20.0)
102
+ test-kitchen (~> 1.4)
103
+ little-plugger (1.1.4)
104
+ logging (2.1.0)
105
+ little-plugger (~> 1.1)
106
+ multi_json (~> 1.10)
107
+ method_source (0.8.2)
108
+ minitar (0.5.4)
109
+ mixlib-authentication (1.4.0)
110
+ mixlib-log
111
+ rspec-core (~> 3.2)
112
+ rspec-expectations (~> 3.2)
113
+ rspec-mocks (~> 3.2)
114
+ mixlib-config (2.2.1)
115
+ mixlib-install (1.0.7)
116
+ artifactory
117
+ mixlib-shellout
118
+ mixlib-versioning
119
+ mixlib-log (1.6.0)
120
+ mixlib-shellout (2.2.6)
121
+ mixlib-versioning (1.1.0)
122
+ molinillo (0.4.4)
123
+ multi_json (1.11.2)
124
+ multipart-post (2.0.0)
125
+ net-scp (1.2.1)
126
+ net-ssh (>= 2.6.5)
127
+ net-ssh (3.1.1)
128
+ nio4r (1.2.1)
129
+ nori (2.6.0)
130
+ octokit (4.3.0)
131
+ sawyer (~> 0.7.0, >= 0.5.3)
132
+ pry (0.10.3)
133
+ coderay (~> 1.1.0)
134
+ method_source (~> 0.8.1)
135
+ slop (~> 3.4)
136
+ r-train (0.10.5)
137
+ docker-api (~> 1.26.2)
138
+ json (~> 1.8)
139
+ mixlib-shellout (~> 2.1)
140
+ net-scp (~> 1.2)
141
+ net-ssh (>= 2.9, < 4.0)
142
+ winrm (~> 1.6)
143
+ winrm-fs (~> 0.3)
144
+ rainbow (2.1.0)
145
+ retryable (2.0.3)
146
+ ridley (4.5.0)
147
+ addressable
148
+ buff-config (~> 1.0)
149
+ buff-extensions (~> 1.0)
150
+ buff-ignore (~> 1.1)
151
+ buff-shell_out (~> 0.1)
152
+ celluloid (~> 0.16.0)
153
+ celluloid-io (~> 0.16.1)
154
+ chef-config (>= 12.5.0)
155
+ erubis
156
+ faraday (~> 0.9.0)
157
+ hashie (>= 2.0.2, < 4.0.0)
158
+ httpclient (~> 2.7)
159
+ json (>= 1.7.7)
160
+ mixlib-authentication (>= 1.3.0)
161
+ retryable (~> 2.0)
162
+ semverse (~> 1.1)
163
+ varia_model (~> 0.4.0)
164
+ rspec (3.4.0)
165
+ rspec-core (~> 3.4.0)
166
+ rspec-expectations (~> 3.4.0)
167
+ rspec-mocks (~> 3.4.0)
168
+ rspec-core (3.4.4)
169
+ rspec-support (~> 3.4.0)
170
+ rspec-expectations (3.4.0)
171
+ diff-lcs (>= 1.2.0, < 2.0)
172
+ rspec-support (~> 3.4.0)
173
+ rspec-its (1.2.0)
174
+ rspec-core (>= 3.0.0)
175
+ rspec-expectations (>= 3.0.0)
176
+ rspec-mocks (3.4.1)
177
+ diff-lcs (>= 1.2.0, < 2.0)
178
+ rspec-support (~> 3.4.0)
179
+ rspec-support (3.4.1)
180
+ rubyntlm (0.6.0)
181
+ rubyzip (1.2.0)
182
+ safe_yaml (1.0.4)
183
+ sawyer (0.7.0)
184
+ addressable (>= 2.3.5, < 2.5)
185
+ faraday (~> 0.8, < 0.10)
186
+ semverse (1.2.1)
187
+ slop (3.6.0)
188
+ solve (2.0.3)
189
+ molinillo (~> 0.4.2)
190
+ semverse (~> 1.1)
191
+ test-kitchen (1.7.3)
192
+ mixlib-install (~> 1.0, >= 1.0.4)
193
+ mixlib-shellout (>= 1.2, < 3.0)
194
+ net-scp (~> 1.1)
195
+ net-ssh (>= 2.9, < 4.0)
196
+ safe_yaml (~> 1.0)
197
+ thor (~> 0.18)
198
+ thor (0.19.1)
199
+ timers (4.0.4)
200
+ hitimes
201
+ varia_model (0.4.1)
202
+ buff-extensions (~> 1.0)
203
+ hashie (>= 2.0.2, < 4.0.0)
204
+ windows_chef_zero (2.0.0)
205
+ test-kitchen (>= 1.2.1)
206
+ winrm (1.7.3)
207
+ builder (>= 2.1.2)
208
+ gssapi (~> 1.2)
209
+ gyoku (~> 1.0)
210
+ httpclient (~> 2.2, >= 2.2.0.2)
211
+ logging (>= 1.6.1, < 3.0)
212
+ nori (~> 2.0)
213
+ rubyntlm (~> 0.6.0)
214
+ winrm-fs (0.4.2)
215
+ erubis (~> 2.7)
216
+ logging (>= 1.6.1, < 3.0)
217
+ rubyzip (~> 1.1)
218
+ winrm (~> 1.5)
219
+
220
+ PLATFORMS
221
+ ruby
222
+
223
+ DEPENDENCIES
224
+ berkshelf
225
+ chef-acceptance!
226
+ inspec
227
+ kitchen-ec2
228
+ kitchen-inspec
229
+ kitchen-vagrant
230
+ test-kitchen
231
+ windows_chef_zero
232
+ winrm-fs
233
+
234
+ BUNDLED WITH
235
+ 1.11.2