chef-dk 1.2.22 → 1.3.40

Sign up to get free protection for your applications and to get access to all the features.
Files changed (232) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +8 -12
  3. data/Gemfile.lock +120 -116
  4. data/README.md +4 -3
  5. data/Rakefile +54 -0
  6. data/acceptance/Gemfile.lock +36 -47
  7. data/bin/chef +1 -1
  8. data/chef-dk.gemspec +9 -9
  9. data/lib/chef-dk/authenticated_http.rb +6 -7
  10. data/lib/chef-dk/builtin_commands.rb +3 -4
  11. data/lib/chef-dk/chef_runner.rb +7 -8
  12. data/lib/chef-dk/cli.rb +11 -11
  13. data/lib/chef-dk/command/base.rb +4 -4
  14. data/lib/chef-dk/command/clean_policy_cookbooks.rb +4 -5
  15. data/lib/chef-dk/command/clean_policy_revisions.rb +4 -6
  16. data/lib/chef-dk/command/delete_policy.rb +4 -6
  17. data/lib/chef-dk/command/delete_policy_group.rb +6 -8
  18. data/lib/chef-dk/command/diff.rb +9 -10
  19. data/lib/chef-dk/command/env.rb +26 -27
  20. data/lib/chef-dk/command/exec.rb +5 -6
  21. data/lib/chef-dk/command/export.rb +8 -10
  22. data/lib/chef-dk/command/gem.rb +5 -5
  23. data/lib/chef-dk/command/generate.rb +19 -19
  24. data/lib/chef-dk/command/generator_commands.rb +8 -8
  25. data/lib/chef-dk/command/generator_commands/app.rb +2 -3
  26. data/lib/chef-dk/command/generator_commands/attribute.rb +2 -3
  27. data/lib/chef-dk/command/generator_commands/base.rb +13 -13
  28. data/lib/chef-dk/command/generator_commands/build_cookbook.rb +2 -2
  29. data/lib/chef-dk/command/generator_commands/chef_exts/generator_desc_resource.rb +2 -2
  30. data/lib/chef-dk/command/generator_commands/chef_exts/quieter_doc_formatter.rb +1 -2
  31. data/lib/chef-dk/command/generator_commands/chef_exts/recipe_dsl_ext.rb +1 -2
  32. data/lib/chef-dk/command/generator_commands/cookbook.rb +2 -2
  33. data/lib/chef-dk/command/generator_commands/cookbook_code_file.rb +3 -3
  34. data/lib/chef-dk/command/generator_commands/cookbook_file.rb +2 -2
  35. data/lib/chef-dk/command/generator_commands/generator_generator.rb +4 -7
  36. data/lib/chef-dk/command/generator_commands/lwrp.rb +2 -2
  37. data/lib/chef-dk/command/generator_commands/policyfile.rb +2 -3
  38. data/lib/chef-dk/command/generator_commands/recipe.rb +2 -2
  39. data/lib/chef-dk/command/generator_commands/repo.rb +1 -3
  40. data/lib/chef-dk/command/generator_commands/template.rb +2 -2
  41. data/lib/chef-dk/command/install.rb +4 -5
  42. data/lib/chef-dk/command/provision.rb +12 -14
  43. data/lib/chef-dk/command/push.rb +5 -6
  44. data/lib/chef-dk/command/push_archive.rb +4 -5
  45. data/lib/chef-dk/command/shell_init.rb +15 -16
  46. data/lib/chef-dk/command/show_policy.rb +5 -7
  47. data/lib/chef-dk/command/undelete.rb +6 -7
  48. data/lib/chef-dk/command/update.rb +5 -6
  49. data/lib/chef-dk/command/verify.rb +30 -31
  50. data/lib/chef-dk/commands_map.rb +1 -3
  51. data/lib/chef-dk/component_test.rb +13 -13
  52. data/lib/chef-dk/configurable.rb +2 -2
  53. data/lib/chef-dk/cookbook_metadata.rb +2 -2
  54. data/lib/chef-dk/cookbook_omnifetch.rb +7 -8
  55. data/lib/chef-dk/cookbook_profiler/git.rb +8 -8
  56. data/lib/chef-dk/cookbook_profiler/identifiers.rb +7 -7
  57. data/lib/chef-dk/cookbook_profiler/null_scm.rb +0 -1
  58. data/lib/chef-dk/exceptions.rb +1 -1
  59. data/lib/chef-dk/generator.rb +9 -7
  60. data/lib/chef-dk/helpers.rb +15 -15
  61. data/lib/chef-dk/pager.rb +2 -3
  62. data/lib/chef-dk/policyfile/chef_repo_cookbook_source.rb +4 -4
  63. data/lib/chef-dk/policyfile/chef_server_cookbook_source.rb +6 -6
  64. data/lib/chef-dk/policyfile/community_cookbook_source.rb +4 -5
  65. data/lib/chef-dk/policyfile/comparison_base.rb +3 -4
  66. data/lib/chef-dk/policyfile/cookbook_location_specification.rb +6 -6
  67. data/lib/chef-dk/policyfile/cookbook_locks.rb +11 -11
  68. data/lib/chef-dk/policyfile/cookbook_sources.rb +5 -5
  69. data/lib/chef-dk/policyfile/delivery_supermarket_source.rb +8 -9
  70. data/lib/chef-dk/policyfile/differ.rb +7 -10
  71. data/lib/chef-dk/policyfile/dsl.rb +10 -11
  72. data/lib/chef-dk/policyfile/lister.rb +3 -6
  73. data/lib/chef-dk/policyfile/null_cookbook_source.rb +3 -3
  74. data/lib/chef-dk/policyfile/read_cookbook_for_compat_mode_upload.rb +3 -3
  75. data/lib/chef-dk/policyfile/reports/install.rb +3 -4
  76. data/lib/chef-dk/policyfile/reports/table_printer.rb +0 -1
  77. data/lib/chef-dk/policyfile/reports/upload.rb +4 -4
  78. data/lib/chef-dk/policyfile/solution_dependencies.rb +22 -22
  79. data/lib/chef-dk/policyfile/source_uri.rb +2 -2
  80. data/lib/chef-dk/policyfile/storage_config.rb +4 -5
  81. data/lib/chef-dk/policyfile/undo_record.rb +6 -9
  82. data/lib/chef-dk/policyfile/undo_stack.rb +5 -7
  83. data/lib/chef-dk/policyfile/uploader.rb +8 -8
  84. data/lib/chef-dk/policyfile_compiler.rb +16 -20
  85. data/lib/chef-dk/policyfile_lock.rb +10 -11
  86. data/lib/chef-dk/policyfile_services/clean_policies.rb +3 -3
  87. data/lib/chef-dk/policyfile_services/clean_policy_cookbooks.rb +3 -5
  88. data/lib/chef-dk/policyfile_services/export_repo.rb +13 -14
  89. data/lib/chef-dk/policyfile_services/install.rb +6 -6
  90. data/lib/chef-dk/policyfile_services/push.rb +6 -8
  91. data/lib/chef-dk/policyfile_services/push_archive.rb +6 -10
  92. data/lib/chef-dk/policyfile_services/rm_policy.rb +4 -5
  93. data/lib/chef-dk/policyfile_services/rm_policy_group.rb +4 -5
  94. data/lib/chef-dk/policyfile_services/show_policy.rb +5 -6
  95. data/lib/chef-dk/policyfile_services/undelete.rb +3 -3
  96. data/lib/chef-dk/policyfile_services/update_attributes.rb +4 -6
  97. data/lib/chef-dk/service_exception_inspectors.rb +2 -3
  98. data/lib/chef-dk/service_exception_inspectors/base.rb +0 -1
  99. data/lib/chef-dk/service_exception_inspectors/http.rb +1 -3
  100. data/lib/chef-dk/service_exceptions.rb +1 -2
  101. data/lib/chef-dk/shell_out.rb +1 -1
  102. data/lib/chef-dk/skeletons/code_generator/files/default/build_cookbook/.kitchen.yml +2 -2
  103. data/lib/chef-dk/skeletons/code_generator/files/default/build_cookbook/README.md +2 -2
  104. data/lib/chef-dk/skeletons/code_generator/files/default/build_cookbook/test-fixture-recipe.rb +1 -0
  105. data/lib/chef-dk/skeletons/code_generator/files/default/repo/cookbooks/example/attributes/default.rb +1 -1
  106. data/lib/chef-dk/skeletons/code_generator/files/default/repo/cookbooks/example/recipes/default.rb +1 -1
  107. data/lib/chef-dk/skeletons/code_generator/metadata.rb +0 -1
  108. data/lib/chef-dk/skeletons/code_generator/recipes/app.rb +6 -6
  109. data/lib/chef-dk/skeletons/code_generator/recipes/attribute.rb +3 -3
  110. data/lib/chef-dk/skeletons/code_generator/recipes/build_cookbook.rb +43 -39
  111. data/lib/chef-dk/skeletons/code_generator/recipes/cookbook.rb +31 -22
  112. data/lib/chef-dk/skeletons/code_generator/recipes/cookbook_file.rb +5 -5
  113. data/lib/chef-dk/skeletons/code_generator/recipes/lwrp.rb +4 -4
  114. data/lib/chef-dk/skeletons/code_generator/recipes/policyfile.rb +1 -1
  115. data/lib/chef-dk/skeletons/code_generator/recipes/recipe.rb +8 -8
  116. data/lib/chef-dk/skeletons/code_generator/recipes/repo.rb +15 -15
  117. data/lib/chef-dk/skeletons/code_generator/recipes/template.rb +6 -6
  118. data/lib/chef-dk/skeletons/code_generator/templates/default/build_cookbook/Berksfile.erb +0 -2
  119. data/lib/chef-dk/skeletons/code_generator/templates/default/build_cookbook/metadata.rb.erb +1 -0
  120. data/lib/chef-dk/skeletons/code_generator/templates/default/inspec_default_test.rb.erb +4 -4
  121. data/lib/chef-dk/skeletons/code_generator/templates/default/kitchen.yml.erb +1 -1
  122. data/lib/chef-dk/skeletons/code_generator/templates/default/kitchen_policyfile.yml.erb +1 -1
  123. data/lib/chef-dk/skeletons/code_generator/templates/default/metadata.rb.erb +4 -3
  124. data/lib/chef-dk/skeletons/code_generator/templates/default/recipe_spec.rb.erb +4 -2
  125. data/lib/chef-dk/ui.rb +0 -1
  126. data/lib/chef-dk/version.rb +1 -1
  127. data/lib/kitchen/provisioner/policyfile_zero.rb +7 -7
  128. data/omnibus_overrides.rb +3 -3
  129. data/spec/shared/a_file_generator.rb +3 -3
  130. data/spec/shared/custom_generator_cookbook.rb +6 -6
  131. data/spec/shared/fixture_cookbook_checksums.rb +2 -3
  132. data/spec/shared/setup_git_committer_config.rb +1 -1
  133. data/spec/shared/setup_git_cookbooks.rb +2 -2
  134. data/spec/spec_helper.rb +5 -5
  135. data/spec/test_helpers.rb +2 -2
  136. data/spec/unit/chef_runner_spec.rb +5 -7
  137. data/spec/unit/cli_spec.rb +36 -37
  138. data/spec/unit/command/base_spec.rb +4 -5
  139. data/spec/unit/command/clean_policy_cookbooks_spec.rb +8 -9
  140. data/spec/unit/command/clean_policy_revisions_spec.rb +8 -9
  141. data/spec/unit/command/delete_policy_group_spec.rb +11 -12
  142. data/spec/unit/command/delete_policy_spec.rb +11 -12
  143. data/spec/unit/command/diff_spec.rb +5 -6
  144. data/spec/unit/command/env_spec.rb +5 -5
  145. data/spec/unit/command/exec_spec.rb +18 -19
  146. data/spec/unit/command/export_spec.rb +5 -6
  147. data/spec/unit/command/generate_spec.rb +10 -10
  148. data/spec/unit/command/generator_commands/app_spec.rb +6 -6
  149. data/spec/unit/command/generator_commands/attribute_spec.rb +3 -4
  150. data/spec/unit/command/generator_commands/base_spec.rb +46 -46
  151. data/spec/unit/command/generator_commands/build_cookbook_spec.rb +50 -16
  152. data/spec/unit/command/generator_commands/chef_exts/generator_desc_resource_spec.rb +9 -9
  153. data/spec/unit/command/generator_commands/chef_exts/recipe_dsl_ext_spec.rb +16 -16
  154. data/spec/unit/command/generator_commands/cookbook_file_spec.rb +3 -4
  155. data/spec/unit/command/generator_commands/cookbook_spec.rb +23 -26
  156. data/spec/unit/command/generator_commands/generator_generator_spec.rb +4 -6
  157. data/spec/unit/command/generator_commands/lwrp_spec.rb +3 -4
  158. data/spec/unit/command/generator_commands/policyfile_spec.rb +3 -5
  159. data/spec/unit/command/generator_commands/recipe_spec.rb +4 -4
  160. data/spec/unit/command/generator_commands/repo_spec.rb +11 -11
  161. data/spec/unit/command/generator_commands/template_spec.rb +3 -4
  162. data/spec/unit/command/install_spec.rb +6 -6
  163. data/spec/unit/command/provision_spec.rb +27 -30
  164. data/spec/unit/command/push_archive_spec.rb +3 -3
  165. data/spec/unit/command/push_spec.rb +5 -6
  166. data/spec/unit/command/shell_init_spec.rb +17 -19
  167. data/spec/unit/command/show_policy_spec.rb +11 -12
  168. data/spec/unit/command/undelete_spec.rb +12 -14
  169. data/spec/unit/command/update_spec.rb +8 -8
  170. data/spec/unit/command/verify_spec.rb +10 -10
  171. data/spec/unit/commands_map_spec.rb +4 -4
  172. data/spec/unit/component_test_spec.rb +3 -3
  173. data/spec/unit/configurable_spec.rb +7 -7
  174. data/spec/unit/cookbook_metadata_spec.rb +5 -7
  175. data/spec/unit/cookbook_profiler/git_spec.rb +6 -7
  176. data/spec/unit/cookbook_profiler/identifiers_spec.rb +5 -7
  177. data/spec/unit/fixtures/command/cli_test_command.rb +2 -2
  178. data/spec/unit/fixtures/configurable/test_configurable.rb +1 -1
  179. data/spec/unit/fixtures/cookbooks_api/update_fixtures.rb +13 -16
  180. data/spec/unit/fixtures/eg_omnibus_dir/valid/embedded/apps/berkshelf/verify_me +1 -1
  181. data/spec/unit/gemfile_util_spec.rb +4 -4
  182. data/spec/unit/generator_spec.rb +10 -10
  183. data/spec/unit/helpers_spec.rb +31 -31
  184. data/spec/unit/pager_spec.rb +5 -7
  185. data/spec/unit/policyfile/chef_repo_cookbook_source_spec.rb +11 -11
  186. data/spec/unit/policyfile/chef_server_cookbook_source_spec.rb +13 -13
  187. data/spec/unit/policyfile/community_cookbook_source_spec.rb +3 -4
  188. data/spec/unit/policyfile/comparison_base_spec.rb +3 -6
  189. data/spec/unit/policyfile/cookbook_location_specification_spec.rb +3 -3
  190. data/spec/unit/policyfile/cookbook_locks_spec.rb +7 -9
  191. data/spec/unit/policyfile/delivery_supermarket_source_spec.rb +16 -17
  192. data/spec/unit/policyfile/differ_spec.rb +4 -5
  193. data/spec/unit/policyfile/lister_spec.rb +31 -35
  194. data/spec/unit/policyfile/null_cookbook_source_spec.rb +2 -3
  195. data/spec/unit/policyfile/read_cookbook_for_compat_mode_upload_spec.rb +3 -3
  196. data/spec/unit/policyfile/reports/install_spec.rb +4 -5
  197. data/spec/unit/policyfile/reports/upload_spec.rb +4 -6
  198. data/spec/unit/policyfile/solution_dependencies_spec.rb +13 -13
  199. data/spec/unit/policyfile/source_uri_spec.rb +5 -5
  200. data/spec/unit/policyfile/storage_config_spec.rb +3 -7
  201. data/spec/unit/policyfile/undo_record_spec.rb +21 -23
  202. data/spec/unit/policyfile/undo_stack_spec.rb +5 -6
  203. data/spec/unit/policyfile/uploader_spec.rb +73 -75
  204. data/spec/unit/policyfile_demands_spec.rb +93 -99
  205. data/spec/unit/policyfile_evaluation_spec.rb +14 -14
  206. data/spec/unit/policyfile_lock_build_spec.rb +64 -65
  207. data/spec/unit/policyfile_lock_install_spec.rb +5 -6
  208. data/spec/unit/policyfile_lock_serialization_spec.rb +14 -15
  209. data/spec/unit/policyfile_lock_validation_spec.rb +17 -20
  210. data/spec/unit/policyfile_services/clean_policies_spec.rb +16 -16
  211. data/spec/unit/policyfile_services/clean_policy_cookbooks_spec.rb +26 -29
  212. data/spec/unit/policyfile_services/export_repo_spec.rb +3 -6
  213. data/spec/unit/policyfile_services/install_spec.rb +5 -7
  214. data/spec/unit/policyfile_services/push_archive_spec.rb +4 -8
  215. data/spec/unit/policyfile_services/push_spec.rb +3 -3
  216. data/spec/unit/policyfile_services/rm_policy_group_spec.rb +16 -20
  217. data/spec/unit/policyfile_services/rm_policy_spec.rb +14 -17
  218. data/spec/unit/policyfile_services/show_policy_spec.rb +78 -80
  219. data/spec/unit/policyfile_services/undelete_spec.rb +5 -7
  220. data/spec/unit/policyfile_services/update_attributes_spec.rb +34 -35
  221. data/spec/unit/service_exception_inspectors/base_spec.rb +2 -4
  222. data/spec/unit/service_exception_inspectors/http_spec.rb +9 -11
  223. data/spec/unit/shell_out_spec.rb +2 -2
  224. data/spec/unit/tasks/helpers_spec.rb +2 -2
  225. data/tasks/bin/bundle-platform +1 -1
  226. data/tasks/bundle_util.rb +1 -1
  227. data/tasks/dependencies.rb +21 -7
  228. data/tasks/gemfile_util.rb +1 -1
  229. data/tasks/helpers.rb +2 -2
  230. data/tasks/version.rb +26 -1
  231. data/version_policy.rb +6 -6
  232. metadata +3 -3
@@ -15,8 +15,8 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require 'spec_helper'
19
- require 'chef-dk/policyfile_services/undelete'
18
+ require "spec_helper"
19
+ require "chef-dk/policyfile_services/undelete"
20
20
 
21
21
  describe ChefDK::PolicyfileServices::Undelete do
22
22
 
@@ -77,7 +77,7 @@ describe ChefDK::PolicyfileServices::Undelete do
77
77
  let(:policy_revision) do
78
78
  {
79
79
  "name" => "appserver",
80
- "revision_id" => "1111111111111111111111111111111111111111111111111111111111111111"
80
+ "revision_id" => "1111111111111111111111111111111111111111111111111111111111111111",
81
81
  }
82
82
  end
83
83
 
@@ -151,7 +151,7 @@ OUTPUT
151
151
  let(:policy_revision) do
152
152
  {
153
153
  "name" => "appserver",
154
- "revision_id" => "1111111111111111111111111111111111111111111111111111111111111111"
154
+ "revision_id" => "1111111111111111111111111111111111111111111111111111111111111111",
155
155
  }
156
156
  end
157
157
 
@@ -259,7 +259,7 @@ OUTPUT
259
259
  let(:policy_revision) do
260
260
  {
261
261
  "name" => "appserver",
262
- "revision_id" => "1111111111111111111111111111111111111111111111111111111111111111"
262
+ "revision_id" => "1111111111111111111111111111111111111111111111111111111111111111",
263
263
  }
264
264
  end
265
265
 
@@ -299,6 +299,4 @@ OUTPUT
299
299
 
300
300
  end
301
301
 
302
-
303
302
  end
304
-
@@ -15,9 +15,9 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require 'spec_helper'
19
- require 'chef-dk/helpers'
20
- require 'chef-dk/policyfile_services/update_attributes'
18
+ require "spec_helper"
19
+ require "chef-dk/helpers"
20
+ require "chef-dk/policyfile_services/update_attributes"
21
21
 
22
22
  describe ChefDK::PolicyfileServices::UpdateAttributes do
23
23
 
@@ -115,25 +115,25 @@ E
115
115
  "revision_id" => "522d740beba4c4e5857bd8bccdb2d7ffd0bbd45ac4350f92b26e4e3b8f68d530",
116
116
  "name" => "install-example",
117
117
  "run_list" => ["recipe[local-cookbook::default]"],
118
- "cookbook_locks"=> {
119
- "local-cookbook"=> {
120
- "version"=>"2.3.4",
121
- "identifier"=>"fab501cfaf747901bd82c1bc706beae7dc3a350c",
122
- "dotted_decimal_identifier"=> "70567763561641081.489844270461035.258281553147148",
123
- "source"=>"cookbooks/local-cookbook",
124
- "cache_key"=>nil,
118
+ "cookbook_locks" => {
119
+ "local-cookbook" => {
120
+ "version" => "2.3.4",
121
+ "identifier" => "fab501cfaf747901bd82c1bc706beae7dc3a350c",
122
+ "dotted_decimal_identifier" => "70567763561641081.489844270461035.258281553147148",
123
+ "source" => "cookbooks/local-cookbook",
124
+ "cache_key" => nil,
125
125
  "scm_info" => nil,
126
- "source_options"=> {
127
- "path"=>"cookbooks/local-cookbook"
128
- }
129
- }
126
+ "source_options" => {
127
+ "path" => "cookbooks/local-cookbook",
128
+ },
129
+ },
130
130
  },
131
- "default_attributes" => {"default_attr"=>"new_value_default"},
132
- "override_attributes" => {"override_attr"=>"new_value_override"},
131
+ "default_attributes" => { "default_attr" => "new_value_default" },
132
+ "override_attributes" => { "override_attr" => "new_value_override" },
133
133
  "solution_dependencies" => {
134
- "Policyfile"=>[["local-cookbook", ">= 0.0.0"]],
135
- "dependencies"=>{"local-cookbook (2.3.4)"=>[]}
136
- }
134
+ "Policyfile" => [["local-cookbook", ">= 0.0.0"]],
135
+ "dependencies" => { "local-cookbook (2.3.4)" => [] },
136
+ },
137
137
  }
138
138
  end
139
139
 
@@ -177,25 +177,25 @@ E
177
177
  "revision_id" => "522d740beba4c4e5857bd8bccdb2d7ffd0bbd45ac4350f92b26e4e3b8f68d530",
178
178
  "name" => "install-example",
179
179
  "run_list" => ["recipe[local-cookbook::default]"],
180
- "cookbook_locks"=> {
181
- "local-cookbook"=> {
182
- "version"=>"2.3.4",
183
- "identifier"=>"fab501cfaf747901bd82c1bc706beae7dc3a350c",
184
- "dotted_decimal_identifier"=> "70567763561641081.489844270461035.258281553147148",
185
- "source"=>"cookbooks/local-cookbook",
180
+ "cookbook_locks" => {
181
+ "local-cookbook" => {
182
+ "version" => "2.3.4",
183
+ "identifier" => "fab501cfaf747901bd82c1bc706beae7dc3a350c",
184
+ "dotted_decimal_identifier" => "70567763561641081.489844270461035.258281553147148",
185
+ "source" => "cookbooks/local-cookbook",
186
186
  "cache_key" => nil,
187
187
  "scm_info" => nil,
188
- "source_options"=> {
189
- "path"=>"cookbooks/local-cookbook"
190
- }
191
- }
188
+ "source_options" => {
189
+ "path" => "cookbooks/local-cookbook",
190
+ },
191
+ },
192
192
  },
193
- "default_attributes" => {"default_attr"=>"old_value_default"},
194
- "override_attributes" => {"override_attr"=>"old_value_override"},
193
+ "default_attributes" => { "default_attr" => "old_value_default" },
194
+ "override_attributes" => { "override_attr" => "old_value_override" },
195
195
  "solution_dependencies" => {
196
- "Policyfile"=>[["local-cookbook", ">= 0.0.0"]],
197
- "dependencies"=>{"local-cookbook (2.3.4)"=>[]}
198
- }
196
+ "Policyfile" => [["local-cookbook", ">= 0.0.0"]],
197
+ "dependencies" => { "local-cookbook (2.3.4)" => [] },
198
+ },
199
199
  }
200
200
  end
201
201
 
@@ -214,4 +214,3 @@ E
214
214
  end
215
215
 
216
216
  end
217
-
@@ -15,9 +15,8 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require 'spec_helper'
19
- require 'chef-dk/service_exception_inspectors/base'
20
-
18
+ require "spec_helper"
19
+ require "chef-dk/service_exception_inspectors/base"
21
20
 
22
21
  describe ChefDK::ServiceExceptionInspectors::Base do
23
22
 
@@ -40,4 +39,3 @@ describe ChefDK::ServiceExceptionInspectors::Base do
40
39
  end
41
40
 
42
41
  end
43
-
@@ -15,10 +15,10 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require 'spec_helper'
19
- require 'net/http'
20
- require 'chef/monkey_patches/net_http'
21
- require 'chef-dk/service_exception_inspectors/http'
18
+ require "spec_helper"
19
+ require "net/http"
20
+ require "chef/monkey_patches/net_http"
21
+ require "chef-dk/service_exception_inspectors/http"
22
22
 
23
23
  describe ChefDK::ServiceExceptionInspectors::HTTP do
24
24
 
@@ -29,7 +29,7 @@ describe ChefDK::ServiceExceptionInspectors::HTTP do
29
29
  let(:request_headers) do
30
30
  {
31
31
  "content-type" => "application/json",
32
- "accept" => "application/json"
32
+ "accept" => "application/json",
33
33
  }
34
34
  end
35
35
 
@@ -42,14 +42,14 @@ describe ChefDK::ServiceExceptionInspectors::HTTP do
42
42
  path: "/organizations/chef-oss-dev/cookbooks",
43
43
  body: request_body)
44
44
  stub = allow(r).to(receive(:each_header))
45
- request_headers.each { |k,v| stub.and_yield(k,v) }
45
+ request_headers.each { |k, v| stub.and_yield(k, v) }
46
46
  r
47
47
  end
48
48
 
49
49
  let(:response_headers) do
50
50
  {
51
51
  "server" => "ngx_openresty",
52
- "date" => "Wed, 29 Oct 2014 22:27:47 GMT"
52
+ "date" => "Wed, 29 Oct 2014 22:27:47 GMT",
53
53
  }
54
54
  end
55
55
 
@@ -59,15 +59,14 @@ describe ChefDK::ServiceExceptionInspectors::HTTP do
59
59
  message: "Bad Request",
60
60
  body: response_body)
61
61
  stub = allow(r).to(receive(:each_header))
62
- response_headers.each { |k,v| stub.and_yield(k,v) }
62
+ response_headers.each { |k, v| stub.and_yield(k, v) }
63
63
  r
64
64
  end
65
65
 
66
66
  let(:exception) do
67
- Net::HTTPServerException.new(message, response).tap {|e| e.chef_rest_request = request }
67
+ Net::HTTPServerException.new(message, response).tap { |e| e.chef_rest_request = request }
68
68
  end
69
69
 
70
-
71
70
  subject(:inspector) { described_class.new(exception) }
72
71
 
73
72
  it "has an exception" do
@@ -137,4 +136,3 @@ E
137
136
  end
138
137
 
139
138
  end
140
-
@@ -15,8 +15,8 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require 'spec_helper'
19
- require 'chef-dk/shell_out'
18
+ require "spec_helper"
19
+ require "chef-dk/shell_out"
20
20
 
21
21
  describe ChefDK::ShellOut do
22
22
 
@@ -26,7 +26,7 @@ describe "Rake 'dependencies' task" do
26
26
  let(:rake_mock) { Class.new { include RakeDependenciesTaskHelpers }.new }
27
27
  let(:product_name) { "chef" }
28
28
  let(:gemfile_name) { "chef" }
29
- let(:gemfile) {'gem "chef", github: "chef/chef", branch: "0.0.0"'}
29
+ let(:gemfile) { 'gem "chef", github: "chef/chef", branch: "0.0.0"' }
30
30
  let(:expected_version) { "0.0.1" }
31
31
 
32
32
  before do
@@ -45,7 +45,7 @@ describe "Rake 'dependencies' task" do
45
45
 
46
46
  context "when gemfile does contain the expected string" do
47
47
  let(:prefix) { "" }
48
- let(:expected_output) {"gem \"chef\", github: \"chef/chef\", branch: \"#{prefix}#{expected_version}\""}
48
+ let(:expected_output) { "gem \"chef\", github: \"chef/chef\", branch: \"#{prefix}#{expected_version}\"" }
49
49
 
50
50
  context "and the version string does not have a prefix" do
51
51
  it "updates the gemfile entry to the newer version" do
@@ -7,7 +7,7 @@ old_platforms = Gem.platforms
7
7
  Gem.platforms = platforms
8
8
  puts "bundle-platform set Gem.platforms to #{Gem.platforms.map { |p| p.to_s }} (was #{old_platforms.map { |p| p.to_s } })"
9
9
 
10
- desired_version = ARGV.shift.gsub("_", "")
10
+ desired_version = ARGV.shift.delete("_")
11
11
 
12
12
  # The rest of this is a normal bundler binstub
13
13
  require "pathname"
@@ -63,7 +63,7 @@ module BundleUtil
63
63
  bundle_platform,
64
64
  ruby_platforms,
65
65
  "_#{desired_bundler_version}_",
66
- *args
66
+ *args,
67
67
  ])
68
68
  puts "#{prefix}#{Shellwords.join(["bundle", *args])}#{platform ? " for #{platform} platform" : ""}:"
69
69
  with_gemfile(gemfile) do
@@ -22,11 +22,24 @@ require_relative "helpers"
22
22
 
23
23
  desc "Tasks to update and check dependencies"
24
24
  namespace :dependencies do
25
- # Update all dependencies to the latest constraint-matching version
25
+
26
+ # Running update_ci on your local system wont' work. The best way to update
27
+ # dependencies locally is by running the dependency update script.
26
28
  desc "Update all dependencies."
27
- # Until 12.14 is released we've removed this first task from update
28
- # dependencies:update_stable_channel_gems
29
- task :update => %w{
29
+ task :update do |t, rake_args|
30
+ system("#{File.join(Dir.pwd, "ci", "dependency_update.sh")}")
31
+ end
32
+
33
+ desc "Force update (when adding new gems to Gemfiles)"
34
+ task :force_update do |t, rake_args|
35
+ FileUtils.rm_f(File.join(Dir.pwd, ".bundle", "config"))
36
+ system("#{File.join(Dir.pwd, "ci", "dependency_update.sh")}")
37
+ end
38
+
39
+ # Update all dependencies to the latest constraint-matching version
40
+ desc "Update all dependencies. (CI Only)"
41
+ task :update_ci => %w{
42
+ dependencies:update_stable_channel_gems
30
43
  dependencies:update_gemfile_lock
31
44
  dependencies:update_omnibus_overrides
32
45
  dependencies:update_omnibus_gemfile_lock
@@ -85,7 +98,7 @@ namespace :dependencies do
85
98
 
86
99
  gemfile_lock_task :update_omnibus_gemfile_lock, dirs: %w{omnibus}
87
100
  gemfile_lock_task :update_acceptance_gemfile_lock, dirs: %w{acceptance},
88
- other_platforms: false, leave_frozen: false
101
+ other_platforms: false, leave_frozen: false
89
102
 
90
103
  desc "Update gems to the versions specified by the stable channel."
91
104
  task :update_stable_channel_gems do |t, rake_args|
@@ -147,5 +160,6 @@ namespace :dependencies do
147
160
  end
148
161
  end
149
162
  desc "Update all dependencies and check for outdated gems."
150
- task :dependencies => [ "dependencies:update", "bundle:outdated" ]
151
- task :update => [ "dependencies:update", "bundle:outdated"]
163
+ task :dependencies_ci => [ "dependencies:update_ci", "bundle:outdated" ]
164
+ task :dependencies => [ "dependencies:update" ]
165
+ task :update => [ "dependencies:update", "bundle:outdated" ]
@@ -10,7 +10,7 @@ module GemfileUtil
10
10
  #
11
11
  # :path does likewise.
12
12
  #
13
- # :overrideable holds off on processing the
13
+ # :overrideable holds off on processing the
14
14
  #
15
15
  def gemfile_parsing_done?
16
16
  overridden_gems == :finished
@@ -17,7 +17,7 @@
17
17
 
18
18
  # Putting this method in a module so it is easier to test
19
19
  module RakeDependenciesTaskHelpers
20
- def update_gemfile_from_stable(gemfile, product_name, gemfile_name, version_prefix="")
20
+ def update_gemfile_from_stable(gemfile, product_name, gemfile_name, version_prefix = "")
21
21
  version = get_latest_version_for(product_name)
22
22
  version = "#{version_prefix}#{version}"
23
23
  found = gemfile.sub!(/^(\s*gem "#{gemfile_name}", github: "chef\/#{gemfile_name}", branch: ")([^"]*)(")$/m) do
@@ -35,7 +35,7 @@ module RakeDependenciesTaskHelpers
35
35
  end
36
36
 
37
37
  def get_latest_version_for(product_name, channel_name = :stable)
38
- require 'mixlib/install'
38
+ require "mixlib/install"
39
39
  puts "Getting latest '#{channel_name}' channel #{product_name} version ..."
40
40
  options = {
41
41
  channel: channel_name.to_sym,
@@ -15,9 +15,32 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
+ task :ci_version_bump do
19
+ begin
20
+ require "rake"
21
+
22
+ Rake::Task["version:bump_patch"].invoke
23
+ Rake::Task["version:update_gemfile_lock"].invoke
24
+
25
+ begin
26
+ Rake::Task["changelog:update"].invoke
27
+ rescue Exception => e
28
+ puts "There was an error updating the CHANGELOG"
29
+ puts e
30
+ end
31
+
32
+ begin
33
+ Rake::Task["update_dockerfile"].invoke
34
+ rescue Exception => e
35
+ puts "There was an error updating the Dockerfile"
36
+ puts e
37
+ end
38
+ end
39
+ end
40
+
18
41
  namespace :version do
19
42
  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 version:update_gemfile_lock}
43
+ task :bump => "ci_version_bump"
21
44
 
22
45
  desc "Show the current version."
23
46
  task :show do
@@ -68,6 +91,7 @@ namespace :version do
68
91
  puts "Updating version in #{version_rb_path} from #{version} to #{new_version.chomp}"
69
92
  IO.write(version_rb_path, new_version_file)
70
93
  IO.write(release_notes_path, "# ChefDK #{$2}.#{$3.to_i + 1} Release Notes")
94
+ Rake::Task["changelog::archive"].invoke
71
95
  Rake::Task["version:update_gemfile_lock"].invoke
72
96
  Rake::Task["bundle:install"].invoke
73
97
  end
@@ -83,6 +107,7 @@ namespace :version do
83
107
  puts "Updating version in #{version_rb_path} from #{version} to #{new_version.chomp}"
84
108
  IO.write(version_rb_path, new_version_file)
85
109
  IO.write(release_notes_path, "# ChefDK #{$2.to_i + 1}.0 Release Notes")
110
+ Rake::Task["changelog::archive"].invoke
86
111
  Rake::Task["version:update_gemfile_lock"].invoke
87
112
  Rake::Task["bundle:install"].invoke
88
113
  end
@@ -47,9 +47,8 @@ OMNIBUS_OVERRIDES = {
47
47
  # software def so we don't need to override that
48
48
  "libzmq" => "4.0.5",
49
49
 
50
- # For 1.2 stable release only, pin to 1.1.0 of kitchen-dokken. After the 1.2
51
- # release, unpin and bring in kitchen-dokken 2.x.
52
- "kitchen-dokken" => "1.1.0"
50
+ # Match what is in Chef Client
51
+ "openssl" => "1.0.2j",
53
52
  }
54
53
 
55
54
  #
@@ -82,16 +81,17 @@ ACCEPTABLE_OUTDATED_GEMS = [
82
81
  "fog-google", # fog-google 0.2+ requires Ruby 2.0+, fog 2.0.0 will include it
83
82
  "google-api-client", # chef-provisioning-fog restricts to < 0.9 for presently unknown reasons
84
83
  "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
84
  "rbvmomi", # fog-vsphere restricts this to a patch version, not sure why
87
85
  "retriable", # anchored by outdated google-api-client
88
- "rubocop", # cookstyle pins to 0.39.0 in 0.0.1
86
+ "rubocop", # cookstyle pins older releases by design
89
87
  "slop", # expected to disappear with pry 0.11
90
88
  "timers", # anchored by outdated celluloid
91
89
  "github_changelog_generator", # we use a forked version that differs from rubygems
92
90
  "addressable", # sawyer limits to < 2.6
93
91
  "faraday", # ridely restrcits this 0.9.x
94
92
  "thor", # berkshelf restricts this to < 0.19.2
93
+ "nokogiri", # fog limits to ~> 1.5
94
+ "mixlib-install", # test kitchen limits to less than 3.x
95
95
 
96
96
  # We have a task called update_stable_channel_gems which scans and pins to the
97
97
  # latest released chef/chef-config/opscode-pushy-client but it pulls from the
@@ -104,7 +104,7 @@ ACCEPTABLE_OUTDATED_GEMS = [
104
104
  "chef",
105
105
  "chef-config",
106
106
  "opscode-pushy-client",
107
- "mixlib-cli"
107
+ "mixlib-cli",
108
108
 
109
109
  ]
110
110
 
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: 1.2.22
4
+ version: 1.3.40
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: 2017-02-02 00:00:00.000000000 Z
13
+ date: 2017-04-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mixlib-cli
@@ -656,7 +656,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
656
656
  version: '0'
657
657
  requirements: []
658
658
  rubyforge_project:
659
- rubygems_version: 2.6.10
659
+ rubygems_version: 2.6.11
660
660
  signing_key:
661
661
  specification_version: 4
662
662
  summary: A streamlined development and deployment workflow for Chef platform.