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,7 +15,7 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
require
|
18
|
+
require "chef-dk/command/generator_commands/cookbook_code_file"
|
19
19
|
|
20
20
|
module ChefDK
|
21
21
|
module Command
|
@@ -28,10 +28,9 @@ module ChefDK
|
|
28
28
|
options.merge!(SharedGeneratorOptions.options)
|
29
29
|
|
30
30
|
def recipe
|
31
|
-
|
31
|
+
"attribute"
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
37
|
-
|
@@ -15,11 +15,11 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
require
|
19
|
-
require
|
18
|
+
require "chef-dk/configurable"
|
19
|
+
require "chef-dk/command/generator_commands"
|
20
20
|
|
21
|
-
require
|
22
|
-
require
|
21
|
+
require "chef-dk/command/generator_commands/chef_exts/recipe_dsl_ext"
|
22
|
+
require "chef-dk/command/generator_commands/chef_exts/generator_desc_resource"
|
23
23
|
|
24
24
|
module ChefDK
|
25
25
|
module Command
|
@@ -71,11 +71,11 @@ module ChefDK
|
|
71
71
|
apply_generator_values_from_config
|
72
72
|
Generator.add_attr_to_context(:have_git, have_git?)
|
73
73
|
Generator.add_attr_to_context(:skip_git_init, false)
|
74
|
-
config.each do |k,v|
|
74
|
+
config.each do |k, v|
|
75
75
|
Generator.add_attr_to_context(k, v)
|
76
76
|
end
|
77
77
|
# inject the arbitrary args supplied on cmdline, default = []
|
78
|
-
config[:generator_arg].each do |k,v|
|
78
|
+
config[:generator_arg].each do |k, v|
|
79
79
|
Generator.add_attr_to_context(k, v)
|
80
80
|
end
|
81
81
|
end
|
@@ -85,7 +85,7 @@ module ChefDK
|
|
85
85
|
def have_git?
|
86
86
|
path = ENV["PATH"] || ""
|
87
87
|
paths = path.split(File::PATH_SEPARATOR)
|
88
|
-
exts = [RbConfig::CONFIG[
|
88
|
+
exts = [RbConfig::CONFIG["EXEEXT"]]
|
89
89
|
exts.concat(ENV["PATHEXT"].split(";")) unless ENV["PATHEXT"].nil?
|
90
90
|
paths.any? do |bin_path|
|
91
91
|
exts.any? do |ext|
|
@@ -136,20 +136,20 @@ module ChefDK
|
|
136
136
|
|
137
137
|
def coerce_generator_copyright_holder
|
138
138
|
generator_config.copyright_holder ||
|
139
|
-
|
140
|
-
|
139
|
+
knife_config.cookbook_copyright ||
|
140
|
+
"The Authors"
|
141
141
|
end
|
142
142
|
|
143
143
|
def coerce_generator_email
|
144
144
|
generator_config.email ||
|
145
|
-
|
146
|
-
|
145
|
+
knife_config.cookbook_email ||
|
146
|
+
"you@example.com"
|
147
147
|
end
|
148
148
|
|
149
149
|
def coerce_generator_license
|
150
150
|
generator_config.license ||
|
151
|
-
|
152
|
-
|
151
|
+
knife_config.cookbook_license ||
|
152
|
+
"all_rights"
|
153
153
|
end
|
154
154
|
end
|
155
155
|
end
|
@@ -15,7 +15,7 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
require
|
18
|
+
require "chef-dk/command/generator_commands/base"
|
19
19
|
|
20
20
|
module ChefDK
|
21
21
|
module Command
|
@@ -30,7 +30,7 @@ module ChefDK
|
|
30
30
|
attr_reader :cookbook_name_or_path
|
31
31
|
|
32
32
|
option :pipeline,
|
33
|
-
:long
|
33
|
+
:long => "--pipeline PIPELINE",
|
34
34
|
:description => "Use PIPELINE to set target branch to something other than master for the build_cookbook",
|
35
35
|
:default => "master"
|
36
36
|
|
@@ -15,7 +15,7 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
require
|
18
|
+
require "chef-dk/command/generator_commands/base"
|
19
19
|
|
20
20
|
module ChefDK
|
21
21
|
module Command
|
@@ -64,7 +64,7 @@ module ChefDK
|
|
64
64
|
default: false
|
65
65
|
|
66
66
|
option :pipeline,
|
67
|
-
:long
|
67
|
+
:long => "--pipeline PIPELINE",
|
68
68
|
:description => "Use PIPELINE to set target branch to something other than master for the build_cookbook",
|
69
69
|
:default => "master"
|
70
70
|
|
@@ -15,7 +15,7 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
require
|
18
|
+
require "chef-dk/command/generator_commands/base"
|
19
19
|
|
20
20
|
module ChefDK
|
21
21
|
module Command
|
@@ -46,7 +46,7 @@ module ChefDK
|
|
46
46
|
setup_context
|
47
47
|
chef_runner.converge
|
48
48
|
else
|
49
|
-
errors.each {|error| err("Error: #{error}") }
|
49
|
+
errors.each { |error| err("Error: #{error}") }
|
50
50
|
parse_options(params)
|
51
51
|
msg(opt_parser)
|
52
52
|
1
|
@@ -85,7 +85,7 @@ module ChefDK
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def validate_cookbook_path
|
88
|
-
unless File.
|
88
|
+
unless File.file?(File.join(cookbook_path, "metadata.rb"))
|
89
89
|
@errors << "Directory #{cookbook_path} is not a cookbook"
|
90
90
|
@params_valid = false
|
91
91
|
end
|
@@ -15,7 +15,7 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
require
|
18
|
+
require "chef-dk/command/generator_commands/cookbook_code_file"
|
19
19
|
|
20
20
|
module ChefDK
|
21
21
|
module Command
|
@@ -32,7 +32,7 @@ module ChefDK
|
|
32
32
|
options.merge!(SharedGeneratorOptions.options)
|
33
33
|
|
34
34
|
def recipe
|
35
|
-
|
35
|
+
"cookbook_file"
|
36
36
|
end
|
37
37
|
|
38
38
|
def setup_context
|
@@ -15,11 +15,11 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
require
|
18
|
+
require "fileutils"
|
19
19
|
|
20
|
-
require
|
21
|
-
require
|
22
|
-
require
|
20
|
+
require "chef-dk/configurable"
|
21
|
+
require "chef-dk/ui"
|
22
|
+
require "chef-dk/command/generator_commands/base"
|
23
23
|
|
24
24
|
module ChefDK
|
25
25
|
module Command
|
@@ -115,7 +115,6 @@ version '0.1.0'
|
|
115
115
|
METADATA
|
116
116
|
end
|
117
117
|
|
118
|
-
|
119
118
|
def custom_cookbook_name?
|
120
119
|
@custom_cookbook_name
|
121
120
|
end
|
@@ -170,8 +169,6 @@ METADATA
|
|
170
169
|
|
171
170
|
end
|
172
171
|
|
173
|
-
|
174
172
|
end
|
175
173
|
end
|
176
174
|
end
|
177
|
-
|
@@ -15,7 +15,7 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
require
|
18
|
+
require "chef-dk/command/generator_commands/cookbook_code_file"
|
19
19
|
|
20
20
|
module ChefDK
|
21
21
|
module Command
|
@@ -28,7 +28,7 @@ module ChefDK
|
|
28
28
|
options.merge!(SharedGeneratorOptions.options)
|
29
29
|
|
30
30
|
def recipe
|
31
|
-
|
31
|
+
"lwrp"
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
@@ -15,7 +15,7 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
require
|
18
|
+
require "chef-dk/command/generator_commands/base"
|
19
19
|
|
20
20
|
module ChefDK
|
21
21
|
module Command
|
@@ -42,7 +42,7 @@ module ChefDK
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def recipe
|
45
|
-
|
45
|
+
"policyfile"
|
46
46
|
end
|
47
47
|
|
48
48
|
def setup_context
|
@@ -88,7 +88,6 @@ module ChefDK
|
|
88
88
|
err("ERROR: too many arguments")
|
89
89
|
return false
|
90
90
|
end
|
91
|
-
|
92
91
|
end
|
93
92
|
|
94
93
|
private
|
@@ -15,7 +15,7 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
require
|
18
|
+
require "chef-dk/command/generator_commands/cookbook_code_file"
|
19
19
|
|
20
20
|
module ChefDK
|
21
21
|
module Command
|
@@ -28,7 +28,7 @@ module ChefDK
|
|
28
28
|
options.merge!(SharedGeneratorOptions.options)
|
29
29
|
|
30
30
|
def recipe
|
31
|
-
|
31
|
+
"recipe"
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
@@ -15,7 +15,7 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
require
|
18
|
+
require "chef-dk/command/generator_commands/base"
|
19
19
|
|
20
20
|
module ChefDK
|
21
21
|
module Command
|
@@ -121,5 +121,3 @@ module ChefDK
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
end
|
124
|
-
|
125
|
-
|
@@ -15,7 +15,7 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
require
|
18
|
+
require "chef-dk/command/generator_commands/cookbook_code_file"
|
19
19
|
|
20
20
|
module ChefDK
|
21
21
|
module Command
|
@@ -33,7 +33,7 @@ module ChefDK
|
|
33
33
|
options.merge!(SharedGeneratorOptions.options)
|
34
34
|
|
35
35
|
def recipe
|
36
|
-
|
36
|
+
"template"
|
37
37
|
end
|
38
38
|
|
39
39
|
def setup_context
|
@@ -15,10 +15,10 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
require
|
19
|
-
require
|
20
|
-
require
|
21
|
-
require
|
18
|
+
require "chef-dk/command/base"
|
19
|
+
require "chef-dk/ui"
|
20
|
+
require "chef-dk/policyfile_services/install"
|
21
|
+
require "chef-dk/configurable"
|
22
22
|
|
23
23
|
module ChefDK
|
24
24
|
module Command
|
@@ -118,4 +118,3 @@ E
|
|
118
118
|
end
|
119
119
|
end
|
120
120
|
end
|
121
|
-
|
@@ -15,14 +15,14 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
require
|
18
|
+
require "ostruct"
|
19
19
|
|
20
|
-
require
|
21
|
-
require
|
22
|
-
require
|
23
|
-
require
|
20
|
+
require "chef-dk/command/base"
|
21
|
+
require "chef-dk/configurable"
|
22
|
+
require "chef-dk/chef_runner"
|
23
|
+
require "chef-dk/policyfile_services/push"
|
24
24
|
|
25
|
-
require
|
25
|
+
require "chef/provisioning"
|
26
26
|
|
27
27
|
module ChefDK
|
28
28
|
|
@@ -66,18 +66,18 @@ module ChefDK
|
|
66
66
|
def convergence_options
|
67
67
|
{
|
68
68
|
chef_server: Chef::Config.chef_server_url,
|
69
|
-
chef_config: chef_config
|
69
|
+
chef_config: chef_config,
|
70
70
|
}
|
71
71
|
end
|
72
72
|
|
73
73
|
def chef_config
|
74
|
-
config
|
74
|
+
config = <<-CONFIG
|
75
75
|
# SSL Settings:
|
76
76
|
ssl_verify_mode #{Chef::Config.ssl_verify_mode.inspect}
|
77
77
|
|
78
78
|
CONFIG
|
79
79
|
if enable_policyfile
|
80
|
-
policyfile_config
|
80
|
+
policyfile_config = <<-CONFIG
|
81
81
|
# Policyfile Settings:
|
82
82
|
use_policyfile true
|
83
83
|
policy_document_native_api true
|
@@ -185,14 +185,14 @@ E
|
|
185
185
|
long: "--target REMOTE_HOST",
|
186
186
|
description: "Set hostname or IP of the host to converge (may be overriden by provisioning cookbook)"
|
187
187
|
|
188
|
-
OPT_SEPARATOR = /[=\s]
|
188
|
+
OPT_SEPARATOR = /[=\s]+/
|
189
189
|
|
190
190
|
def self.split_opt(key_value)
|
191
191
|
key, _separator, value = key_value.partition(OPT_SEPARATOR)
|
192
192
|
[key, value]
|
193
193
|
end
|
194
194
|
|
195
|
-
opts={}
|
195
|
+
opts = {}
|
196
196
|
|
197
197
|
option :opts,
|
198
198
|
short: "-o OPT=VALUE",
|
@@ -207,7 +207,6 @@ E
|
|
207
207
|
description: "Enable stacktraces and other debug output",
|
208
208
|
default: false
|
209
209
|
|
210
|
-
|
211
210
|
attr_reader :params
|
212
211
|
attr_reader :policyfile_relative_path
|
213
212
|
attr_reader :policy_group
|
@@ -371,7 +370,7 @@ E
|
|
371
370
|
end
|
372
371
|
|
373
372
|
def provisioning_recipe_path
|
374
|
-
File.join(cookbook_expanded_path,
|
373
|
+
File.join(cookbook_expanded_path, "recipes", "#{recipe}.rb")
|
375
374
|
end
|
376
375
|
|
377
376
|
def cookbook_expanded_path
|
@@ -435,4 +434,3 @@ E
|
|
435
434
|
end
|
436
435
|
end
|
437
436
|
end
|
438
|
-
|
data/lib/chef-dk/command/push.rb
CHANGED
@@ -15,10 +15,10 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
require
|
19
|
-
require
|
20
|
-
require
|
21
|
-
require
|
18
|
+
require "chef-dk/command/base"
|
19
|
+
require "chef-dk/ui"
|
20
|
+
require "chef-dk/policyfile_services/push"
|
21
|
+
require "chef-dk/configurable"
|
22
22
|
|
23
23
|
module ChefDK
|
24
24
|
module Command
|
@@ -102,7 +102,7 @@ E
|
|
102
102
|
|
103
103
|
def apply_params!(params)
|
104
104
|
remaining_args = parse_options(params)
|
105
|
-
if remaining_args.size < 1
|
105
|
+
if remaining_args.size < 1 || remaining_args.size > 2
|
106
106
|
ui.err(opt_parser)
|
107
107
|
return false
|
108
108
|
else
|
@@ -115,4 +115,3 @@ E
|
|
115
115
|
end
|
116
116
|
end
|
117
117
|
end
|
118
|
-
|