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.
- checksums.yaml +4 -4
- data/Gemfile +8 -12
- data/Gemfile.lock +120 -116
- data/README.md +4 -3
- data/Rakefile +54 -0
- data/acceptance/Gemfile.lock +36 -47
- data/bin/chef +1 -1
- data/chef-dk.gemspec +9 -9
- data/lib/chef-dk/authenticated_http.rb +6 -7
- data/lib/chef-dk/builtin_commands.rb +3 -4
- data/lib/chef-dk/chef_runner.rb +7 -8
- data/lib/chef-dk/cli.rb +11 -11
- data/lib/chef-dk/command/base.rb +4 -4
- data/lib/chef-dk/command/clean_policy_cookbooks.rb +4 -5
- data/lib/chef-dk/command/clean_policy_revisions.rb +4 -6
- data/lib/chef-dk/command/delete_policy.rb +4 -6
- data/lib/chef-dk/command/delete_policy_group.rb +6 -8
- data/lib/chef-dk/command/diff.rb +9 -10
- data/lib/chef-dk/command/env.rb +26 -27
- data/lib/chef-dk/command/exec.rb +5 -6
- data/lib/chef-dk/command/export.rb +8 -10
- data/lib/chef-dk/command/gem.rb +5 -5
- data/lib/chef-dk/command/generate.rb +19 -19
- data/lib/chef-dk/command/generator_commands.rb +8 -8
- data/lib/chef-dk/command/generator_commands/app.rb +2 -3
- data/lib/chef-dk/command/generator_commands/attribute.rb +2 -3
- data/lib/chef-dk/command/generator_commands/base.rb +13 -13
- data/lib/chef-dk/command/generator_commands/build_cookbook.rb +2 -2
- data/lib/chef-dk/command/generator_commands/chef_exts/generator_desc_resource.rb +2 -2
- data/lib/chef-dk/command/generator_commands/chef_exts/quieter_doc_formatter.rb +1 -2
- data/lib/chef-dk/command/generator_commands/chef_exts/recipe_dsl_ext.rb +1 -2
- data/lib/chef-dk/command/generator_commands/cookbook.rb +2 -2
- data/lib/chef-dk/command/generator_commands/cookbook_code_file.rb +3 -3
- data/lib/chef-dk/command/generator_commands/cookbook_file.rb +2 -2
- data/lib/chef-dk/command/generator_commands/generator_generator.rb +4 -7
- data/lib/chef-dk/command/generator_commands/lwrp.rb +2 -2
- data/lib/chef-dk/command/generator_commands/policyfile.rb +2 -3
- data/lib/chef-dk/command/generator_commands/recipe.rb +2 -2
- data/lib/chef-dk/command/generator_commands/repo.rb +1 -3
- data/lib/chef-dk/command/generator_commands/template.rb +2 -2
- data/lib/chef-dk/command/install.rb +4 -5
- data/lib/chef-dk/command/provision.rb +12 -14
- data/lib/chef-dk/command/push.rb +5 -6
- data/lib/chef-dk/command/push_archive.rb +4 -5
- data/lib/chef-dk/command/shell_init.rb +15 -16
- data/lib/chef-dk/command/show_policy.rb +5 -7
- data/lib/chef-dk/command/undelete.rb +6 -7
- data/lib/chef-dk/command/update.rb +5 -6
- data/lib/chef-dk/command/verify.rb +30 -31
- data/lib/chef-dk/commands_map.rb +1 -3
- data/lib/chef-dk/component_test.rb +13 -13
- data/lib/chef-dk/configurable.rb +2 -2
- data/lib/chef-dk/cookbook_metadata.rb +2 -2
- data/lib/chef-dk/cookbook_omnifetch.rb +7 -8
- data/lib/chef-dk/cookbook_profiler/git.rb +8 -8
- data/lib/chef-dk/cookbook_profiler/identifiers.rb +7 -7
- data/lib/chef-dk/cookbook_profiler/null_scm.rb +0 -1
- data/lib/chef-dk/exceptions.rb +1 -1
- data/lib/chef-dk/generator.rb +9 -7
- data/lib/chef-dk/helpers.rb +15 -15
- data/lib/chef-dk/pager.rb +2 -3
- data/lib/chef-dk/policyfile/chef_repo_cookbook_source.rb +4 -4
- data/lib/chef-dk/policyfile/chef_server_cookbook_source.rb +6 -6
- data/lib/chef-dk/policyfile/community_cookbook_source.rb +4 -5
- data/lib/chef-dk/policyfile/comparison_base.rb +3 -4
- data/lib/chef-dk/policyfile/cookbook_location_specification.rb +6 -6
- data/lib/chef-dk/policyfile/cookbook_locks.rb +11 -11
- data/lib/chef-dk/policyfile/cookbook_sources.rb +5 -5
- data/lib/chef-dk/policyfile/delivery_supermarket_source.rb +8 -9
- data/lib/chef-dk/policyfile/differ.rb +7 -10
- data/lib/chef-dk/policyfile/dsl.rb +10 -11
- data/lib/chef-dk/policyfile/lister.rb +3 -6
- data/lib/chef-dk/policyfile/null_cookbook_source.rb +3 -3
- data/lib/chef-dk/policyfile/read_cookbook_for_compat_mode_upload.rb +3 -3
- data/lib/chef-dk/policyfile/reports/install.rb +3 -4
- data/lib/chef-dk/policyfile/reports/table_printer.rb +0 -1
- data/lib/chef-dk/policyfile/reports/upload.rb +4 -4
- data/lib/chef-dk/policyfile/solution_dependencies.rb +22 -22
- data/lib/chef-dk/policyfile/source_uri.rb +2 -2
- data/lib/chef-dk/policyfile/storage_config.rb +4 -5
- data/lib/chef-dk/policyfile/undo_record.rb +6 -9
- data/lib/chef-dk/policyfile/undo_stack.rb +5 -7
- data/lib/chef-dk/policyfile/uploader.rb +8 -8
- data/lib/chef-dk/policyfile_compiler.rb +16 -20
- data/lib/chef-dk/policyfile_lock.rb +10 -11
- data/lib/chef-dk/policyfile_services/clean_policies.rb +3 -3
- data/lib/chef-dk/policyfile_services/clean_policy_cookbooks.rb +3 -5
- data/lib/chef-dk/policyfile_services/export_repo.rb +13 -14
- data/lib/chef-dk/policyfile_services/install.rb +6 -6
- data/lib/chef-dk/policyfile_services/push.rb +6 -8
- data/lib/chef-dk/policyfile_services/push_archive.rb +6 -10
- data/lib/chef-dk/policyfile_services/rm_policy.rb +4 -5
- data/lib/chef-dk/policyfile_services/rm_policy_group.rb +4 -5
- data/lib/chef-dk/policyfile_services/show_policy.rb +5 -6
- data/lib/chef-dk/policyfile_services/undelete.rb +3 -3
- data/lib/chef-dk/policyfile_services/update_attributes.rb +4 -6
- data/lib/chef-dk/service_exception_inspectors.rb +2 -3
- data/lib/chef-dk/service_exception_inspectors/base.rb +0 -1
- data/lib/chef-dk/service_exception_inspectors/http.rb +1 -3
- data/lib/chef-dk/service_exceptions.rb +1 -2
- data/lib/chef-dk/shell_out.rb +1 -1
- data/lib/chef-dk/skeletons/code_generator/files/default/build_cookbook/.kitchen.yml +2 -2
- data/lib/chef-dk/skeletons/code_generator/files/default/build_cookbook/README.md +2 -2
- 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/repo/cookbooks/example/attributes/default.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/metadata.rb +0 -1
- data/lib/chef-dk/skeletons/code_generator/recipes/app.rb +6 -6
- data/lib/chef-dk/skeletons/code_generator/recipes/attribute.rb +3 -3
- data/lib/chef-dk/skeletons/code_generator/recipes/build_cookbook.rb +43 -39
- data/lib/chef-dk/skeletons/code_generator/recipes/cookbook.rb +31 -22
- data/lib/chef-dk/skeletons/code_generator/recipes/cookbook_file.rb +5 -5
- data/lib/chef-dk/skeletons/code_generator/recipes/lwrp.rb +4 -4
- data/lib/chef-dk/skeletons/code_generator/recipes/policyfile.rb +1 -1
- data/lib/chef-dk/skeletons/code_generator/recipes/recipe.rb +8 -8
- data/lib/chef-dk/skeletons/code_generator/recipes/repo.rb +15 -15
- data/lib/chef-dk/skeletons/code_generator/recipes/template.rb +6 -6
- data/lib/chef-dk/skeletons/code_generator/templates/default/build_cookbook/Berksfile.erb +0 -2
- data/lib/chef-dk/skeletons/code_generator/templates/default/build_cookbook/metadata.rb.erb +1 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/inspec_default_test.rb.erb +4 -4
- data/lib/chef-dk/skeletons/code_generator/templates/default/kitchen.yml.erb +1 -1
- data/lib/chef-dk/skeletons/code_generator/templates/default/kitchen_policyfile.yml.erb +1 -1
- data/lib/chef-dk/skeletons/code_generator/templates/default/metadata.rb.erb +4 -3
- data/lib/chef-dk/skeletons/code_generator/templates/default/recipe_spec.rb.erb +4 -2
- data/lib/chef-dk/ui.rb +0 -1
- data/lib/chef-dk/version.rb +1 -1
- data/lib/kitchen/provisioner/policyfile_zero.rb +7 -7
- data/omnibus_overrides.rb +3 -3
- data/spec/shared/a_file_generator.rb +3 -3
- data/spec/shared/custom_generator_cookbook.rb +6 -6
- data/spec/shared/fixture_cookbook_checksums.rb +2 -3
- data/spec/shared/setup_git_committer_config.rb +1 -1
- data/spec/shared/setup_git_cookbooks.rb +2 -2
- data/spec/spec_helper.rb +5 -5
- data/spec/test_helpers.rb +2 -2
- data/spec/unit/chef_runner_spec.rb +5 -7
- data/spec/unit/cli_spec.rb +36 -37
- data/spec/unit/command/base_spec.rb +4 -5
- data/spec/unit/command/clean_policy_cookbooks_spec.rb +8 -9
- data/spec/unit/command/clean_policy_revisions_spec.rb +8 -9
- data/spec/unit/command/delete_policy_group_spec.rb +11 -12
- data/spec/unit/command/delete_policy_spec.rb +11 -12
- data/spec/unit/command/diff_spec.rb +5 -6
- data/spec/unit/command/env_spec.rb +5 -5
- data/spec/unit/command/exec_spec.rb +18 -19
- data/spec/unit/command/export_spec.rb +5 -6
- data/spec/unit/command/generate_spec.rb +10 -10
- data/spec/unit/command/generator_commands/app_spec.rb +6 -6
- data/spec/unit/command/generator_commands/attribute_spec.rb +3 -4
- data/spec/unit/command/generator_commands/base_spec.rb +46 -46
- data/spec/unit/command/generator_commands/build_cookbook_spec.rb +50 -16
- data/spec/unit/command/generator_commands/chef_exts/generator_desc_resource_spec.rb +9 -9
- data/spec/unit/command/generator_commands/chef_exts/recipe_dsl_ext_spec.rb +16 -16
- data/spec/unit/command/generator_commands/cookbook_file_spec.rb +3 -4
- data/spec/unit/command/generator_commands/cookbook_spec.rb +23 -26
- data/spec/unit/command/generator_commands/generator_generator_spec.rb +4 -6
- data/spec/unit/command/generator_commands/lwrp_spec.rb +3 -4
- data/spec/unit/command/generator_commands/policyfile_spec.rb +3 -5
- data/spec/unit/command/generator_commands/recipe_spec.rb +4 -4
- data/spec/unit/command/generator_commands/repo_spec.rb +11 -11
- data/spec/unit/command/generator_commands/template_spec.rb +3 -4
- data/spec/unit/command/install_spec.rb +6 -6
- data/spec/unit/command/provision_spec.rb +27 -30
- data/spec/unit/command/push_archive_spec.rb +3 -3
- data/spec/unit/command/push_spec.rb +5 -6
- data/spec/unit/command/shell_init_spec.rb +17 -19
- data/spec/unit/command/show_policy_spec.rb +11 -12
- data/spec/unit/command/undelete_spec.rb +12 -14
- data/spec/unit/command/update_spec.rb +8 -8
- data/spec/unit/command/verify_spec.rb +10 -10
- data/spec/unit/commands_map_spec.rb +4 -4
- data/spec/unit/component_test_spec.rb +3 -3
- data/spec/unit/configurable_spec.rb +7 -7
- data/spec/unit/cookbook_metadata_spec.rb +5 -7
- data/spec/unit/cookbook_profiler/git_spec.rb +6 -7
- data/spec/unit/cookbook_profiler/identifiers_spec.rb +5 -7
- data/spec/unit/fixtures/command/cli_test_command.rb +2 -2
- data/spec/unit/fixtures/configurable/test_configurable.rb +1 -1
- data/spec/unit/fixtures/cookbooks_api/update_fixtures.rb +13 -16
- data/spec/unit/fixtures/eg_omnibus_dir/valid/embedded/apps/berkshelf/verify_me +1 -1
- data/spec/unit/gemfile_util_spec.rb +4 -4
- data/spec/unit/generator_spec.rb +10 -10
- data/spec/unit/helpers_spec.rb +31 -31
- data/spec/unit/pager_spec.rb +5 -7
- data/spec/unit/policyfile/chef_repo_cookbook_source_spec.rb +11 -11
- data/spec/unit/policyfile/chef_server_cookbook_source_spec.rb +13 -13
- data/spec/unit/policyfile/community_cookbook_source_spec.rb +3 -4
- data/spec/unit/policyfile/comparison_base_spec.rb +3 -6
- data/spec/unit/policyfile/cookbook_location_specification_spec.rb +3 -3
- data/spec/unit/policyfile/cookbook_locks_spec.rb +7 -9
- data/spec/unit/policyfile/delivery_supermarket_source_spec.rb +16 -17
- data/spec/unit/policyfile/differ_spec.rb +4 -5
- data/spec/unit/policyfile/lister_spec.rb +31 -35
- data/spec/unit/policyfile/null_cookbook_source_spec.rb +2 -3
- data/spec/unit/policyfile/read_cookbook_for_compat_mode_upload_spec.rb +3 -3
- data/spec/unit/policyfile/reports/install_spec.rb +4 -5
- data/spec/unit/policyfile/reports/upload_spec.rb +4 -6
- data/spec/unit/policyfile/solution_dependencies_spec.rb +13 -13
- data/spec/unit/policyfile/source_uri_spec.rb +5 -5
- data/spec/unit/policyfile/storage_config_spec.rb +3 -7
- data/spec/unit/policyfile/undo_record_spec.rb +21 -23
- data/spec/unit/policyfile/undo_stack_spec.rb +5 -6
- data/spec/unit/policyfile/uploader_spec.rb +73 -75
- data/spec/unit/policyfile_demands_spec.rb +93 -99
- data/spec/unit/policyfile_evaluation_spec.rb +14 -14
- data/spec/unit/policyfile_lock_build_spec.rb +64 -65
- data/spec/unit/policyfile_lock_install_spec.rb +5 -6
- data/spec/unit/policyfile_lock_serialization_spec.rb +14 -15
- data/spec/unit/policyfile_lock_validation_spec.rb +17 -20
- data/spec/unit/policyfile_services/clean_policies_spec.rb +16 -16
- data/spec/unit/policyfile_services/clean_policy_cookbooks_spec.rb +26 -29
- data/spec/unit/policyfile_services/export_repo_spec.rb +3 -6
- data/spec/unit/policyfile_services/install_spec.rb +5 -7
- data/spec/unit/policyfile_services/push_archive_spec.rb +4 -8
- data/spec/unit/policyfile_services/push_spec.rb +3 -3
- data/spec/unit/policyfile_services/rm_policy_group_spec.rb +16 -20
- data/spec/unit/policyfile_services/rm_policy_spec.rb +14 -17
- data/spec/unit/policyfile_services/show_policy_spec.rb +78 -80
- data/spec/unit/policyfile_services/undelete_spec.rb +5 -7
- data/spec/unit/policyfile_services/update_attributes_spec.rb +34 -35
- data/spec/unit/service_exception_inspectors/base_spec.rb +2 -4
- data/spec/unit/service_exception_inspectors/http_spec.rb +9 -11
- data/spec/unit/shell_out_spec.rb +2 -2
- data/spec/unit/tasks/helpers_spec.rb +2 -2
- data/tasks/bin/bundle-platform +1 -1
- data/tasks/bundle_util.rb +1 -1
- data/tasks/dependencies.rb +21 -7
- data/tasks/gemfile_util.rb +1 -1
- data/tasks/helpers.rb +2 -2
- data/tasks/version.rb +26 -1
- data/version_policy.rb +6 -6
- metadata +3 -3
@@ -15,8 +15,8 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
require
|
19
|
-
require
|
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
|
19
|
-
require
|
20
|
-
require
|
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
|
19
|
-
require
|
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
|
19
|
-
require
|
20
|
-
require
|
21
|
-
require
|
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
|
-
|
data/spec/unit/shell_out_spec.rb
CHANGED
@@ -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
|
data/tasks/bin/bundle-platform
CHANGED
@@ -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.
|
10
|
+
desired_version = ARGV.shift.delete("_")
|
11
11
|
|
12
12
|
# The rest of this is a normal bundler binstub
|
13
13
|
require "pathname"
|
data/tasks/bundle_util.rb
CHANGED
data/tasks/dependencies.rb
CHANGED
@@ -22,11 +22,24 @@ require_relative "helpers"
|
|
22
22
|
|
23
23
|
desc "Tasks to update and check dependencies"
|
24
24
|
namespace :dependencies do
|
25
|
-
|
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
|
-
|
28
|
-
|
29
|
-
|
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
|
-
|
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 :
|
151
|
-
task :
|
163
|
+
task :dependencies_ci => [ "dependencies:update_ci", "bundle:outdated" ]
|
164
|
+
task :dependencies => [ "dependencies:update" ]
|
165
|
+
task :update => [ "dependencies:update", "bundle:outdated" ]
|
data/tasks/gemfile_util.rb
CHANGED
data/tasks/helpers.rb
CHANGED
@@ -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
|
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,
|
data/tasks/version.rb
CHANGED
@@ -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 =>
|
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
|
data/version_policy.rb
CHANGED
@@ -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
|
-
#
|
51
|
-
|
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
|
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.
|
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-
|
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.
|
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.
|