chef-dk 3.13.1 → 4.0.60
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +33 -25
- data/Gemfile.lock +317 -293
- data/LICENSE +0 -0
- data/Rakefile +0 -0
- data/bin/chef +1 -1
- data/chef-dk.gemspec +3 -3
- data/lib/chef-dk.rb +0 -0
- data/lib/chef-dk/authenticated_http.rb +0 -0
- data/lib/chef-dk/builtin_commands.rb +1 -3
- data/lib/chef-dk/chef_runner.rb +0 -0
- data/lib/chef-dk/chef_server_api_multi.rb +0 -0
- data/lib/chef-dk/cli.rb +2 -3
- data/lib/chef-dk/command/base.rb +9 -1
- data/lib/chef-dk/command/clean_policy_cookbooks.rb +2 -3
- data/lib/chef-dk/command/clean_policy_revisions.rb +3 -4
- data/lib/chef-dk/command/delete_policy.rb +1 -1
- data/lib/chef-dk/command/delete_policy_group.rb +1 -2
- data/lib/chef-dk/command/describe_cookbook.rb +5 -4
- data/lib/chef-dk/command/diff.rb +7 -9
- data/lib/chef-dk/command/env.rb +0 -0
- data/lib/chef-dk/command/exec.rb +0 -0
- data/lib/chef-dk/command/export.rb +0 -1
- data/lib/chef-dk/command/gem.rb +0 -0
- data/lib/chef-dk/command/generate.rb +1 -6
- data/lib/chef-dk/command/generator_commands.rb +0 -0
- data/lib/chef-dk/command/generator_commands/attribute.rb +0 -0
- data/lib/chef-dk/command/generator_commands/base.rb +0 -0
- data/lib/chef-dk/command/generator_commands/build_cookbook.rb +7 -7
- data/lib/chef-dk/command/generator_commands/chef_exts/generator_desc_resource.rb +4 -49
- data/lib/chef-dk/command/generator_commands/chef_exts/quieter_doc_formatter.rb +0 -0
- data/lib/chef-dk/command/generator_commands/chef_exts/recipe_dsl_ext.rb +0 -0
- data/lib/chef-dk/command/generator_commands/cookbook.rb +22 -23
- data/lib/chef-dk/command/generator_commands/cookbook_code_file.rb +0 -0
- data/lib/chef-dk/command/generator_commands/cookbook_file.rb +0 -0
- data/lib/chef-dk/command/generator_commands/generator_generator.rb +0 -0
- data/lib/chef-dk/command/generator_commands/helpers.rb +0 -0
- data/lib/chef-dk/command/generator_commands/policyfile.rb +0 -0
- data/lib/chef-dk/command/generator_commands/recipe.rb +0 -0
- data/lib/chef-dk/command/generator_commands/repo.rb +25 -9
- data/lib/chef-dk/command/generator_commands/resource.rb +0 -0
- data/lib/chef-dk/command/generator_commands/template.rb +0 -0
- data/lib/chef-dk/command/install.rb +1 -2
- data/lib/chef-dk/command/provision.rb +2 -404
- data/lib/chef-dk/command/push.rb +1 -2
- data/lib/chef-dk/command/push_archive.rb +2 -2
- data/lib/chef-dk/command/shell_init.rb +9 -5
- data/lib/chef-dk/command/show_policy.rb +0 -1
- data/lib/chef-dk/command/undelete.rb +0 -1
- data/lib/chef-dk/command/update.rb +0 -1
- data/lib/chef-dk/command/verify.rb +13 -110
- data/lib/chef-dk/commands_map.rb +0 -0
- data/lib/chef-dk/completions/bash.sh.erb +0 -0
- data/lib/chef-dk/completions/chef.fish.erb +0 -0
- data/lib/chef-dk/completions/zsh.zsh.erb +0 -0
- data/lib/chef-dk/component_test.rb +4 -2
- data/lib/chef-dk/configurable.rb +0 -1
- data/lib/chef-dk/cookbook_metadata.rb +0 -0
- data/lib/chef-dk/cookbook_omnifetch.rb +0 -0
- data/lib/chef-dk/cookbook_profiler/git.rb +0 -0
- data/lib/chef-dk/cookbook_profiler/identifiers.rb +0 -0
- data/lib/chef-dk/cookbook_profiler/null_scm.rb +0 -0
- data/lib/chef-dk/exceptions.rb +1 -1
- data/lib/chef-dk/generator.rb +1 -1
- data/lib/chef-dk/helpers.rb +1 -2
- data/lib/chef-dk/pager.rb +0 -0
- data/lib/chef-dk/policyfile/artifactory_cookbook_source.rb +0 -0
- data/lib/chef-dk/policyfile/attribute_merge_checker.rb +0 -0
- data/lib/chef-dk/policyfile/chef_repo_cookbook_source.rb +0 -0
- data/lib/chef-dk/policyfile/chef_server_cookbook_source.rb +0 -0
- data/lib/chef-dk/policyfile/chef_server_lock_fetcher.rb +2 -2
- data/lib/chef-dk/policyfile/community_cookbook_source.rb +0 -0
- data/lib/chef-dk/policyfile/comparison_base.rb +0 -0
- data/lib/chef-dk/policyfile/cookbook_location_specification.rb +0 -0
- data/lib/chef-dk/policyfile/cookbook_locks.rb +1 -1
- data/lib/chef-dk/policyfile/cookbook_sources.rb +0 -0
- data/lib/chef-dk/policyfile/delivery_supermarket_source.rb +0 -0
- data/lib/chef-dk/policyfile/differ.rb +0 -0
- data/lib/chef-dk/policyfile/dsl.rb +1 -1
- data/lib/chef-dk/policyfile/git_lock_fetcher.rb +0 -0
- data/lib/chef-dk/policyfile/included_policies_cookbook_source.rb +0 -0
- data/lib/chef-dk/policyfile/lister.rb +0 -0
- data/lib/chef-dk/policyfile/local_lock_fetcher.rb +0 -0
- data/lib/chef-dk/policyfile/lock_applier.rb +0 -0
- data/lib/chef-dk/policyfile/lock_fetcher_mixin.rb +0 -0
- data/lib/chef-dk/policyfile/null_cookbook_source.rb +0 -0
- data/lib/chef-dk/policyfile/policyfile_location_specification.rb +0 -0
- data/lib/chef-dk/policyfile/read_cookbook_for_compat_mode_upload.rb +0 -0
- data/lib/chef-dk/policyfile/remote_lock_fetcher.rb +0 -0
- data/lib/chef-dk/policyfile/reports/install.rb +0 -0
- data/lib/chef-dk/policyfile/reports/table_printer.rb +0 -0
- data/lib/chef-dk/policyfile/reports/upload.rb +0 -0
- data/lib/chef-dk/policyfile/solution_dependencies.rb +1 -1
- data/lib/chef-dk/policyfile/source_uri.rb +0 -0
- data/lib/chef-dk/policyfile/storage_config.rb +0 -0
- data/lib/chef-dk/policyfile/undo_record.rb +0 -0
- data/lib/chef-dk/policyfile/undo_stack.rb +0 -0
- data/lib/chef-dk/policyfile/uploader.rb +0 -0
- data/lib/chef-dk/policyfile_compiler.rb +2 -4
- data/lib/chef-dk/policyfile_lock.rb +1 -3
- data/lib/chef-dk/policyfile_services/clean_policies.rb +0 -0
- data/lib/chef-dk/policyfile_services/clean_policy_cookbooks.rb +0 -0
- data/lib/chef-dk/policyfile_services/export_repo.rb +6 -6
- data/lib/chef-dk/policyfile_services/install.rb +0 -0
- data/lib/chef-dk/policyfile_services/push.rb +0 -0
- data/lib/chef-dk/policyfile_services/push_archive.rb +2 -2
- data/lib/chef-dk/policyfile_services/rm_policy.rb +0 -0
- data/lib/chef-dk/policyfile_services/rm_policy_group.rb +0 -0
- data/lib/chef-dk/policyfile_services/show_policy.rb +0 -0
- data/lib/chef-dk/policyfile_services/undelete.rb +0 -0
- data/lib/chef-dk/policyfile_services/update_attributes.rb +0 -0
- data/lib/chef-dk/service_exception_inspectors.rb +0 -0
- data/lib/chef-dk/service_exception_inspectors/base.rb +0 -0
- data/lib/chef-dk/service_exception_inspectors/http.rb +0 -0
- data/lib/chef-dk/service_exceptions.rb +0 -0
- data/lib/chef-dk/shell_out.rb +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/Berksfile +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/build_cookbook/README.md +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/build_cookbook/kitchen.yml +1 -1
- data/lib/chef-dk/skeletons/code_generator/files/default/build_cookbook/test-fixture-recipe.rb +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/chefignore +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/cookbook_readmes/README-policy.md +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/cookbook_readmes/README.md +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/delivery-config.json +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/delivery-project.toml +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/gitignore +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/README.md +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/cookbooks/example/README.md +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/cookbooks/example/attributes/default.rb +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/cookbooks/example/metadata.rb +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/cookbooks/example/recipes/default.rb +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/data_bags/README.md +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/data_bags/example/example_item.json +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/dot-chef-repo.txt +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/environments/README.md +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/environments/example.json +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/policyfiles/README.md +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/roles/README.md +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/repo/roles/example.json +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/spec_helper.rb +0 -0
- data/lib/chef-dk/skeletons/code_generator/files/default/spec_helper_policyfile.rb +0 -0
- data/lib/chef-dk/skeletons/code_generator/metadata.rb +0 -0
- data/lib/chef-dk/skeletons/code_generator/recipes/attribute.rb +0 -0
- data/lib/chef-dk/skeletons/code_generator/recipes/build_cookbook.rb +20 -20
- data/lib/chef-dk/skeletons/code_generator/recipes/cookbook.rb +24 -16
- data/lib/chef-dk/skeletons/code_generator/recipes/cookbook_file.rb +0 -0
- data/lib/chef-dk/skeletons/code_generator/recipes/helpers.rb +0 -0
- data/lib/chef-dk/skeletons/code_generator/recipes/policyfile.rb +0 -0
- data/lib/chef-dk/skeletons/code_generator/recipes/recipe.rb +0 -0
- data/lib/chef-dk/skeletons/code_generator/recipes/repo.rb +7 -3
- data/lib/chef-dk/skeletons/code_generator/recipes/resource.rb +0 -0
- data/lib/chef-dk/skeletons/code_generator/recipes/template.rb +0 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/CHANGELOG.md.erb +0 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/LICENSE.all_rights.erb +0 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/LICENSE.apachev2.erb +0 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/LICENSE.gplv2.erb +0 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/LICENSE.gplv3.erb +0 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/LICENSE.mit.erb +0 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/Policyfile.rb.erb +0 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/README.md.erb +0 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/attribute.rb.erb +0 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/build_cookbook/Berksfile.erb +1 -1
- data/lib/chef-dk/skeletons/code_generator/templates/default/build_cookbook/metadata.rb.erb +1 -1
- data/lib/chef-dk/skeletons/code_generator/templates/default/build_cookbook/recipe.rb.erb +0 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/cookbook_file.erb +0 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/helpers.rb.erb +0 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/inspec_default_test.rb.erb +0 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/kitchen.yml.erb +1 -1
- data/lib/chef-dk/skeletons/code_generator/templates/default/kitchen_dokken.yml.erb +0 -0
- 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 +1 -1
- data/lib/chef-dk/skeletons/code_generator/templates/default/recipe.rb.erb +0 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/recipe_spec.rb.erb +0 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/repo/gitignore.erb +0 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/resource.rb.erb +0 -0
- data/lib/chef-dk/skeletons/code_generator/templates/default/template.erb +0 -0
- data/lib/chef-dk/ui.rb +0 -0
- data/lib/chef-dk/version.rb +1 -1
- data/lib/kitchen/provisioner/policyfile_zero.rb +0 -0
- data/spec/shared/a_file_generator.rb +0 -0
- data/spec/shared/a_generated_file.rb +0 -0
- data/spec/shared/command_with_ui_object.rb +0 -0
- data/spec/shared/custom_generator_cookbook.rb +0 -0
- data/spec/shared/fixture_cookbook_checksums.rb +1 -1
- data/spec/shared/setup_git_committer_config.rb +0 -0
- data/spec/shared/setup_git_cookbooks.rb +0 -0
- data/spec/spec_helper.rb +0 -4
- data/spec/test_helpers.rb +0 -0
- data/spec/unit/chef_runner_spec.rb +0 -0
- data/spec/unit/chef_server_api_multi_spec.rb +0 -0
- data/spec/unit/cli_spec.rb +0 -0
- data/spec/unit/command/base_spec.rb +24 -1
- data/spec/unit/command/clean_policy_cookbooks_spec.rb +0 -0
- data/spec/unit/command/clean_policy_revisions_spec.rb +0 -0
- data/spec/unit/command/delete_policy_group_spec.rb +0 -0
- data/spec/unit/command/delete_policy_spec.rb +0 -0
- data/spec/unit/command/diff_spec.rb +0 -0
- data/spec/unit/command/env_spec.rb +1 -1
- data/spec/unit/command/exec_spec.rb +1 -1
- data/spec/unit/command/export_spec.rb +0 -0
- data/spec/unit/command/generate_spec.rb +0 -0
- data/spec/unit/command/generator_commands/attribute_spec.rb +0 -0
- data/spec/unit/command/generator_commands/base_spec.rb +0 -0
- data/spec/unit/command/generator_commands/build_cookbook_spec.rb +15 -15
- data/spec/unit/command/generator_commands/chef_exts/generator_desc_resource_spec.rb +6 -26
- data/spec/unit/command/generator_commands/chef_exts/recipe_dsl_ext_spec.rb +0 -0
- data/spec/unit/command/generator_commands/cookbook_file_spec.rb +0 -0
- data/spec/unit/command/generator_commands/cookbook_spec.rb +200 -203
- data/spec/unit/command/generator_commands/generator_generator_spec.rb +7 -7
- data/spec/unit/command/generator_commands/helpers_spec.rb +0 -0
- data/spec/unit/command/generator_commands/policyfile_spec.rb +0 -0
- data/spec/unit/command/generator_commands/recipe_spec.rb +1 -2
- data/spec/unit/command/generator_commands/repo_spec.rb +8 -8
- data/spec/unit/command/generator_commands/resource_spec.rb +0 -0
- data/spec/unit/command/generator_commands/template_spec.rb +0 -0
- data/spec/unit/command/install_spec.rb +0 -0
- data/spec/unit/command/push_archive_spec.rb +0 -0
- data/spec/unit/command/push_spec.rb +0 -0
- data/spec/unit/command/shell_init_spec.rb +0 -0
- data/spec/unit/command/show_policy_spec.rb +0 -0
- data/spec/unit/command/undelete_spec.rb +0 -0
- data/spec/unit/command/update_spec.rb +0 -0
- data/spec/unit/command/verify_spec.rb +2 -3
- data/spec/unit/commands_map_spec.rb +0 -0
- data/spec/unit/component_test_spec.rb +0 -0
- data/spec/unit/configurable_spec.rb +0 -0
- data/spec/unit/cookbook_metadata_spec.rb +0 -0
- data/spec/unit/cookbook_profiler/git_spec.rb +0 -0
- data/spec/unit/cookbook_profiler/identifiers_spec.rb +3 -3
- data/spec/unit/fixtures/chef-runner-cookbooks/test_cookbook/recipes/recipe_one.rb +0 -0
- data/spec/unit/fixtures/chef-runner-cookbooks/test_cookbook/recipes/recipe_two.rb +0 -0
- data/spec/unit/fixtures/command/cli_test_command.rb +0 -0
- data/spec/unit/fixtures/command/explicit_path_example.rb +0 -0
- data/spec/unit/fixtures/configurable/test_config_loader.rb +0 -0
- data/spec/unit/fixtures/configurable/test_configurable.rb +0 -0
- data/spec/unit/fixtures/cookbook_cache/baz-f59ee7a5bca6a4e606b67f7f856b768d847c39bb/.kitchen.yml +0 -0
- data/spec/unit/fixtures/cookbook_cache/baz-f59ee7a5bca6a4e606b67f7f856b768d847c39bb/Berksfile +0 -0
- data/spec/unit/fixtures/cookbook_cache/baz-f59ee7a5bca6a4e606b67f7f856b768d847c39bb/README.md +0 -0
- data/spec/unit/fixtures/cookbook_cache/baz-f59ee7a5bca6a4e606b67f7f856b768d847c39bb/chefignore +0 -0
- data/spec/unit/fixtures/cookbook_cache/baz-f59ee7a5bca6a4e606b67f7f856b768d847c39bb/metadata.rb +0 -0
- data/spec/unit/fixtures/cookbook_cache/baz-f59ee7a5bca6a4e606b67f7f856b768d847c39bb/recipes/default.rb +0 -0
- data/spec/unit/fixtures/cookbook_cache/dep_of_bar-1.2.3/.kitchen.yml +0 -0
- data/spec/unit/fixtures/cookbook_cache/dep_of_bar-1.2.3/Berksfile +0 -0
- data/spec/unit/fixtures/cookbook_cache/dep_of_bar-1.2.3/README.md +0 -0
- data/spec/unit/fixtures/cookbook_cache/dep_of_bar-1.2.3/chefignore +0 -0
- data/spec/unit/fixtures/cookbook_cache/dep_of_bar-1.2.3/metadata.rb +0 -0
- data/spec/unit/fixtures/cookbook_cache/dep_of_bar-1.2.3/recipes/default.rb +0 -0
- data/spec/unit/fixtures/cookbook_cache/foo-1.0.0/Berksfile +0 -0
- data/spec/unit/fixtures/cookbook_cache/foo-1.0.0/README.md +0 -0
- data/spec/unit/fixtures/cookbook_cache/foo-1.0.0/chefignore +0 -0
- data/spec/unit/fixtures/cookbook_cache/foo-1.0.0/{.kitchen.yml → kitchen.yml} +0 -0
- data/spec/unit/fixtures/cookbook_cache/foo-1.0.0/metadata.rb +0 -0
- data/spec/unit/fixtures/cookbook_cache/foo-1.0.0/recipes/default.rb +0 -0
- data/spec/unit/fixtures/cookbooks_api/chef_server_universe.json +0 -0
- data/spec/unit/fixtures/cookbooks_api/pruned_chef_server_universe.json +0 -0
- data/spec/unit/fixtures/cookbooks_api/pruned_small_universe.json +0 -0
- data/spec/unit/fixtures/cookbooks_api/small_universe.json +0 -0
- data/spec/unit/fixtures/cookbooks_api/universe.json +0 -0
- data/spec/unit/fixtures/cookbooks_api/update_fixtures.rb +0 -0
- data/spec/unit/fixtures/dev_cookbooks/README.md +0 -0
- data/spec/unit/fixtures/dev_cookbooks/bar-cookbook.gitbundle +0 -0
- data/spec/unit/fixtures/eg_omnibus_dir/missing_apps/bin/.keep +0 -0
- data/spec/unit/fixtures/eg_omnibus_dir/missing_apps/embedded/.keep +0 -0
- data/spec/unit/fixtures/eg_omnibus_dir/missing_apps/embedded/bin/.keep +0 -0
- data/spec/unit/fixtures/eg_omnibus_dir/missing_component/bin/.keep +0 -0
- data/spec/unit/fixtures/eg_omnibus_dir/missing_component/embedded/apps/berkshelf/.keep +0 -0
- data/spec/unit/fixtures/eg_omnibus_dir/missing_component/embedded/apps/test-kitchen/.keep +0 -0
- data/spec/unit/fixtures/eg_omnibus_dir/missing_component/embedded/bin/.keep +0 -0
- data/spec/unit/fixtures/eg_omnibus_dir/valid/bin/.keep +0 -0
- data/spec/unit/fixtures/eg_omnibus_dir/valid/embedded/apps/chef-dk/.keep +0 -0
- data/spec/unit/fixtures/eg_omnibus_dir/valid/embedded/bin/.keep +0 -0
- data/spec/unit/fixtures/example_app/Policyfile.rb +0 -0
- data/spec/unit/fixtures/example_cookbook/.gitignore +0 -0
- data/spec/unit/fixtures/example_cookbook/.kitchen.yml +0 -0
- data/spec/unit/fixtures/example_cookbook/Berksfile +0 -0
- data/spec/unit/fixtures/example_cookbook/README.md +0 -0
- data/spec/unit/fixtures/example_cookbook/chefignore +0 -0
- data/spec/unit/fixtures/example_cookbook/metadata.rb +0 -0
- data/spec/unit/fixtures/example_cookbook/recipes/default.rb +0 -0
- data/spec/unit/fixtures/example_cookbook_metadata_json_only/.gitignore +0 -0
- data/spec/unit/fixtures/example_cookbook_metadata_json_only/.kitchen.yml +0 -0
- data/spec/unit/fixtures/example_cookbook_metadata_json_only/Berksfile +0 -0
- data/spec/unit/fixtures/example_cookbook_metadata_json_only/README.md +0 -0
- data/spec/unit/fixtures/example_cookbook_metadata_json_only/chefignore +0 -0
- data/spec/unit/fixtures/example_cookbook_metadata_json_only/metadata.json +0 -0
- data/spec/unit/fixtures/example_cookbook_metadata_json_only/recipes/default.rb +0 -0
- data/spec/unit/fixtures/example_cookbook_no_metadata/.gitignore +0 -0
- data/spec/unit/fixtures/example_cookbook_no_metadata/.kitchen.yml +0 -0
- data/spec/unit/fixtures/example_cookbook_no_metadata/Berksfile +0 -0
- data/spec/unit/fixtures/example_cookbook_no_metadata/README.md +0 -0
- data/spec/unit/fixtures/example_cookbook_no_metadata/chefignore +0 -0
- data/spec/unit/fixtures/example_cookbook_no_metadata/recipes/default.rb +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/another-local-cookbook/README.md +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/another-local-cookbook/chefignore +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/another-local-cookbook/metadata.rb +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/another-local-cookbook/recipes/default.rb +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/cookbook-with-a-dep/Berksfile +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/cookbook-with-a-dep/README.md +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/cookbook-with-a-dep/chefignore +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/cookbook-with-a-dep/metadata.rb +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/cookbook-with-a-dep/recipes/default.rb +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/local-cookbook/.kitchen.yml +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/local-cookbook/Berksfile +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/local-cookbook/README.md +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/local-cookbook/chefignore +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/local-cookbook/extra/extra_file.txt +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/local-cookbook/metadata.rb +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/local-cookbook/recipes/default.rb +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/metadata-missing/README.md +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/noignore-f59ee7a5bca6a4e606b67f7f856b768d847c39bb/.kitchen.yml +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/noignore-f59ee7a5bca6a4e606b67f7f856b768d847c39bb/README.md +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/noignore-f59ee7a5bca6a4e606b67f7f856b768d847c39bb/metadata.rb +0 -0
- data/spec/unit/fixtures/local_path_cookbooks/noignore-f59ee7a5bca6a4e606b67f7f856b768d847c39bb/recipes/default.rb +0 -0
- data/spec/unit/generator_spec.rb +0 -0
- data/spec/unit/pager_spec.rb +0 -0
- data/spec/unit/policyfile/artifactory_cookbook_source_spec.rb +0 -0
- data/spec/unit/policyfile/attribute_merge_checker_spec.rb +0 -0
- data/spec/unit/policyfile/chef_repo_cookbook_source_spec.rb +0 -0
- data/spec/unit/policyfile/chef_server_cookbook_source_spec.rb +0 -0
- data/spec/unit/policyfile/chef_server_lock_fetcher_spec.rb +0 -0
- data/spec/unit/policyfile/community_cookbook_source_spec.rb +0 -0
- data/spec/unit/policyfile/comparison_base_spec.rb +0 -0
- data/spec/unit/policyfile/cookbook_location_specification_spec.rb +0 -0
- data/spec/unit/policyfile/cookbook_locks_spec.rb +0 -0
- data/spec/unit/policyfile/delivery_supermarket_source_spec.rb +0 -0
- data/spec/unit/policyfile/differ_spec.rb +0 -0
- data/spec/unit/policyfile/git_lock_fetcher_spec.rb +0 -0
- data/spec/unit/policyfile/included_policies_cookbook_source_spec.rb +0 -0
- data/spec/unit/policyfile/lister_spec.rb +0 -0
- data/spec/unit/policyfile/local_lock_fetcher_spec.rb +0 -0
- data/spec/unit/policyfile/lock_applier_spec.rb +0 -0
- data/spec/unit/policyfile/lock_fetcher_mixin_spec.rb +0 -0
- data/spec/unit/policyfile/null_cookbook_source_spec.rb +0 -0
- data/spec/unit/policyfile/read_cookbook_for_compat_mode_upload_spec.rb +0 -0
- data/spec/unit/policyfile/remote_lock_fetcher_spec.rb +0 -0
- data/spec/unit/policyfile/reports/install_spec.rb +0 -0
- data/spec/unit/policyfile/reports/upload_spec.rb +0 -0
- data/spec/unit/policyfile/solution_dependencies_spec.rb +0 -0
- data/spec/unit/policyfile/source_uri_spec.rb +0 -0
- data/spec/unit/policyfile/storage_config_spec.rb +0 -0
- data/spec/unit/policyfile/undo_record_spec.rb +0 -0
- data/spec/unit/policyfile/undo_stack_spec.rb +0 -0
- data/spec/unit/policyfile/uploader_spec.rb +0 -0
- data/spec/unit/policyfile_demands_spec.rb +0 -0
- data/spec/unit/policyfile_evaluation_spec.rb +0 -0
- data/spec/unit/policyfile_includes_dsl_spec.rb +0 -0
- data/spec/unit/policyfile_includes_spec.rb +0 -0
- data/spec/unit/policyfile_install_with_includes_spec.rb +0 -0
- data/spec/unit/policyfile_lock_build_spec.rb +2 -2
- data/spec/unit/policyfile_lock_install_spec.rb +0 -0
- data/spec/unit/policyfile_lock_serialization_spec.rb +0 -0
- data/spec/unit/policyfile_lock_validation_spec.rb +0 -0
- data/spec/unit/policyfile_services/clean_policies_spec.rb +0 -0
- data/spec/unit/policyfile_services/clean_policy_cookbooks_spec.rb +0 -0
- data/spec/unit/policyfile_services/export_repo_spec.rb +6 -6
- data/spec/unit/policyfile_services/install_spec.rb +0 -0
- data/spec/unit/policyfile_services/push_archive_spec.rb +2 -2
- data/spec/unit/policyfile_services/push_spec.rb +0 -0
- data/spec/unit/policyfile_services/rm_policy_group_spec.rb +0 -0
- data/spec/unit/policyfile_services/rm_policy_spec.rb +0 -0
- data/spec/unit/policyfile_services/show_policy_spec.rb +0 -0
- data/spec/unit/policyfile_services/undelete_spec.rb +0 -0
- data/spec/unit/policyfile_services/update_attributes_spec.rb +0 -0
- data/spec/unit/policyfile_services/update_spec.rb +0 -0
- data/spec/unit/service_exception_inspectors/base_spec.rb +0 -0
- data/spec/unit/service_exception_inspectors/http_spec.rb +1 -1
- data/spec/unit/shell_out_spec.rb +0 -0
- data/warning.txt +3 -2
- metadata +20 -19
- data/lib/chef-dk/command/generator_commands/app.rb +0 -106
- data/lib/chef-dk/skeletons/code_generator/recipes/app.rb +0 -87
- data/spec/unit/command/generator_commands/app_spec.rb +0 -166
- data/spec/unit/command/provision_spec.rb +0 -589
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -269,7 +269,7 @@ describe ChefDK::PolicyfileServices::ExportRepo do
|
|
269
269
|
|
270
270
|
it "creates a working local mode configuration file" do
|
271
271
|
expected_config_text = <<~CONFIG
|
272
|
-
### Chef Client Configuration ###
|
272
|
+
### Chef Infra Client Configuration ###
|
273
273
|
# The settings in this file will configure chef to apply the exported policy in
|
274
274
|
# this directory. To use it, run:
|
275
275
|
#
|
@@ -358,21 +358,21 @@ describe ChefDK::PolicyfileServices::ExportRepo do
|
|
358
358
|
|
359
359
|
context "When the export dir has conflicting content" do
|
360
360
|
|
361
|
-
let(:non_conflicting_file_in_export_dir) { File.join(
|
361
|
+
let(:non_conflicting_file_in_export_dir) { File.join(export_dir, "some_random_cruft") }
|
362
362
|
|
363
|
-
let(:cookbook_artifacts_dir) { File.join(
|
363
|
+
let(:cookbook_artifacts_dir) { File.join(export_dir, "cookbook_artifacts") }
|
364
364
|
|
365
365
|
let(:file_in_cookbook_artifacts_dir) { File.join(cookbook_artifacts_dir, "some_random_cruft") }
|
366
366
|
|
367
|
-
let(:policies_dir) { File.join(
|
367
|
+
let(:policies_dir) { File.join(export_dir, "policies") }
|
368
368
|
|
369
|
-
let(:policy_groups_dir) { File.join(
|
369
|
+
let(:policy_groups_dir) { File.join(export_dir, "policy_groups") }
|
370
370
|
|
371
371
|
let(:extra_policy_item) { File.join(policies_dir, "leftover-policy.json") }
|
372
372
|
|
373
373
|
let(:extra_policy_group_item) { File.join(policy_groups_dir, "leftover-policy-group.json") }
|
374
374
|
|
375
|
-
let(:conflicting_policyfile_lock) { File.join(
|
375
|
+
let(:conflicting_policyfile_lock) { File.join(export_dir, "Policyfile.lock.json") }
|
376
376
|
|
377
377
|
before do
|
378
378
|
FileUtils.mkdir_p(export_dir)
|
File without changes
|
@@ -287,8 +287,8 @@ describe ChefDK::PolicyfileServices::PushArchive do
|
|
287
287
|
This archive is in an unsupported format.
|
288
288
|
|
289
289
|
This archive was created with an older version of ChefDK. This version of
|
290
|
-
ChefDK does not support archives in the older format. Re-create the
|
291
|
-
with a newer version of ChefDK or
|
290
|
+
ChefDK does not support archives in the older format. Please Re-create the
|
291
|
+
archive with a newer version of ChefDK or Workstation.
|
292
292
|
MESSAGE
|
293
293
|
expect(exception_cause.message).to eq(msg)
|
294
294
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -93,7 +93,7 @@ describe ChefDK::ServiceExceptionInspectors::HTTP do
|
|
93
93
|
|
94
94
|
end
|
95
95
|
|
96
|
-
context "with a JSON response body in the standard Chef Server format" do
|
96
|
+
context "with a JSON response body in the standard Chef Infra Server format" do
|
97
97
|
|
98
98
|
let(:response_body) { %q[{"error":["Field 'name' invalid"]}] }
|
99
99
|
|
data/spec/unit/shell_out_spec.rb
CHANGED
File without changes
|
data/warning.txt
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
Thanks for installing chef-dk! Unfortunately, since
|
1
|
+
Thanks for installing chef-dk! Unfortunately, since Chef Development Kit is
|
2
2
|
supposed to be installed as the omnibus binaries in order to support various
|
3
3
|
platforms, this is not the official way to install chef-dk.
|
4
4
|
|
5
5
|
Please download the latest version for your operating system from the URL below,
|
6
6
|
and make sure you have uninstalled your chef-dk gem to avoid conflicts:
|
7
7
|
|
8
|
-
https://downloads.chef.io/
|
8
|
+
https://downloads.chef.io/chef-dk/
|
9
|
+
|
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:
|
4
|
+
version: 4.0.60
|
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:
|
13
|
+
date: 2019-05-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mixlib-cli
|
@@ -92,14 +92,14 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
95
|
+
version: '15.0'
|
96
96
|
type: :runtime
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
102
|
+
version: '15.0'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: solve
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -183,19 +183,25 @@ dependencies:
|
|
183
183
|
- !ruby/object:Gem::Version
|
184
184
|
version: '1.0'
|
185
185
|
- !ruby/object:Gem::Dependency
|
186
|
-
name:
|
186
|
+
name: license-acceptance
|
187
187
|
requirement: !ruby/object:Gem::Requirement
|
188
188
|
requirements:
|
189
189
|
- - "~>"
|
190
190
|
- !ruby/object:Gem::Version
|
191
|
-
version: '
|
191
|
+
version: '1.0'
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: 1.0.11
|
192
195
|
type: :runtime
|
193
196
|
prerelease: false
|
194
197
|
version_requirements: !ruby/object:Gem::Requirement
|
195
198
|
requirements:
|
196
199
|
- - "~>"
|
197
200
|
- !ruby/object:Gem::Version
|
198
|
-
version: '
|
201
|
+
version: '1.0'
|
202
|
+
- - ">="
|
203
|
+
- !ruby/object:Gem::Version
|
204
|
+
version: 1.0.11
|
199
205
|
- !ruby/object:Gem::Dependency
|
200
206
|
name: rspec-core
|
201
207
|
requirement: !ruby/object:Gem::Requirement
|
@@ -273,7 +279,6 @@ files:
|
|
273
279
|
- lib/chef-dk/command/gem.rb
|
274
280
|
- lib/chef-dk/command/generate.rb
|
275
281
|
- lib/chef-dk/command/generator_commands.rb
|
276
|
-
- lib/chef-dk/command/generator_commands/app.rb
|
277
282
|
- lib/chef-dk/command/generator_commands/attribute.rb
|
278
283
|
- lib/chef-dk/command/generator_commands/base.rb
|
279
284
|
- lib/chef-dk/command/generator_commands/build_cookbook.rb
|
@@ -390,7 +395,6 @@ files:
|
|
390
395
|
- lib/chef-dk/skeletons/code_generator/files/default/spec_helper.rb
|
391
396
|
- lib/chef-dk/skeletons/code_generator/files/default/spec_helper_policyfile.rb
|
392
397
|
- lib/chef-dk/skeletons/code_generator/metadata.rb
|
393
|
-
- lib/chef-dk/skeletons/code_generator/recipes/app.rb
|
394
398
|
- lib/chef-dk/skeletons/code_generator/recipes/attribute.rb
|
395
399
|
- lib/chef-dk/skeletons/code_generator/recipes/build_cookbook.rb
|
396
400
|
- lib/chef-dk/skeletons/code_generator/recipes/cookbook.rb
|
@@ -450,7 +454,6 @@ files:
|
|
450
454
|
- spec/unit/command/exec_spec.rb
|
451
455
|
- spec/unit/command/export_spec.rb
|
452
456
|
- spec/unit/command/generate_spec.rb
|
453
|
-
- spec/unit/command/generator_commands/app_spec.rb
|
454
457
|
- spec/unit/command/generator_commands/attribute_spec.rb
|
455
458
|
- spec/unit/command/generator_commands/base_spec.rb
|
456
459
|
- spec/unit/command/generator_commands/build_cookbook_spec.rb
|
@@ -466,7 +469,6 @@ files:
|
|
466
469
|
- spec/unit/command/generator_commands/resource_spec.rb
|
467
470
|
- spec/unit/command/generator_commands/template_spec.rb
|
468
471
|
- spec/unit/command/install_spec.rb
|
469
|
-
- spec/unit/command/provision_spec.rb
|
470
472
|
- spec/unit/command/push_archive_spec.rb
|
471
473
|
- spec/unit/command/push_spec.rb
|
472
474
|
- spec/unit/command/shell_init_spec.rb
|
@@ -498,10 +500,10 @@ files:
|
|
498
500
|
- spec/unit/fixtures/cookbook_cache/dep_of_bar-1.2.3/chefignore
|
499
501
|
- spec/unit/fixtures/cookbook_cache/dep_of_bar-1.2.3/metadata.rb
|
500
502
|
- spec/unit/fixtures/cookbook_cache/dep_of_bar-1.2.3/recipes/default.rb
|
501
|
-
- spec/unit/fixtures/cookbook_cache/foo-1.0.0/.kitchen.yml
|
502
503
|
- spec/unit/fixtures/cookbook_cache/foo-1.0.0/Berksfile
|
503
504
|
- spec/unit/fixtures/cookbook_cache/foo-1.0.0/README.md
|
504
505
|
- spec/unit/fixtures/cookbook_cache/foo-1.0.0/chefignore
|
506
|
+
- spec/unit/fixtures/cookbook_cache/foo-1.0.0/kitchen.yml
|
505
507
|
- spec/unit/fixtures/cookbook_cache/foo-1.0.0/metadata.rb
|
506
508
|
- spec/unit/fixtures/cookbook_cache/foo-1.0.0/recipes/default.rb
|
507
509
|
- spec/unit/fixtures/cookbooks_api/chef_server_universe.json
|
@@ -627,15 +629,16 @@ homepage: https://www.chef.io/
|
|
627
629
|
licenses:
|
628
630
|
- Apache-2.0
|
629
631
|
metadata: {}
|
630
|
-
post_install_message:
|
631
|
-
Thanks for installing chef-dk! Unfortunately, since
|
632
|
+
post_install_message: |+
|
633
|
+
Thanks for installing chef-dk! Unfortunately, since Chef Development Kit is
|
632
634
|
supposed to be installed as the omnibus binaries in order to support various
|
633
635
|
platforms, this is not the official way to install chef-dk.
|
634
636
|
|
635
637
|
Please download the latest version for your operating system from the URL below,
|
636
638
|
and make sure you have uninstalled your chef-dk gem to avoid conflicts:
|
637
639
|
|
638
|
-
https://downloads.chef.io/
|
640
|
+
https://downloads.chef.io/chef-dk/
|
641
|
+
|
639
642
|
rdoc_options: []
|
640
643
|
require_paths:
|
641
644
|
- lib
|
@@ -643,7 +646,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
643
646
|
requirements:
|
644
647
|
- - ">="
|
645
648
|
- !ruby/object:Gem::Version
|
646
|
-
version: '2.
|
649
|
+
version: '2.5'
|
647
650
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
648
651
|
requirements:
|
649
652
|
- - ">="
|
@@ -677,7 +680,6 @@ test_files:
|
|
677
680
|
- spec/unit/command/exec_spec.rb
|
678
681
|
- spec/unit/command/export_spec.rb
|
679
682
|
- spec/unit/command/generate_spec.rb
|
680
|
-
- spec/unit/command/generator_commands/app_spec.rb
|
681
683
|
- spec/unit/command/generator_commands/attribute_spec.rb
|
682
684
|
- spec/unit/command/generator_commands/base_spec.rb
|
683
685
|
- spec/unit/command/generator_commands/build_cookbook_spec.rb
|
@@ -693,7 +695,6 @@ test_files:
|
|
693
695
|
- spec/unit/command/generator_commands/resource_spec.rb
|
694
696
|
- spec/unit/command/generator_commands/template_spec.rb
|
695
697
|
- spec/unit/command/install_spec.rb
|
696
|
-
- spec/unit/command/provision_spec.rb
|
697
698
|
- spec/unit/command/push_archive_spec.rb
|
698
699
|
- spec/unit/command/push_spec.rb
|
699
700
|
- spec/unit/command/shell_init_spec.rb
|
@@ -725,10 +726,10 @@ test_files:
|
|
725
726
|
- spec/unit/fixtures/cookbook_cache/dep_of_bar-1.2.3/chefignore
|
726
727
|
- spec/unit/fixtures/cookbook_cache/dep_of_bar-1.2.3/metadata.rb
|
727
728
|
- spec/unit/fixtures/cookbook_cache/dep_of_bar-1.2.3/recipes/default.rb
|
728
|
-
- spec/unit/fixtures/cookbook_cache/foo-1.0.0/.kitchen.yml
|
729
729
|
- spec/unit/fixtures/cookbook_cache/foo-1.0.0/Berksfile
|
730
730
|
- spec/unit/fixtures/cookbook_cache/foo-1.0.0/README.md
|
731
731
|
- spec/unit/fixtures/cookbook_cache/foo-1.0.0/chefignore
|
732
|
+
- spec/unit/fixtures/cookbook_cache/foo-1.0.0/kitchen.yml
|
732
733
|
- spec/unit/fixtures/cookbook_cache/foo-1.0.0/metadata.rb
|
733
734
|
- spec/unit/fixtures/cookbook_cache/foo-1.0.0/recipes/default.rb
|
734
735
|
- spec/unit/fixtures/cookbooks_api/chef_server_universe.json
|
@@ -1,106 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright:: Copyright (c) 2014-2018 Chef Software Inc.
|
3
|
-
# License:: Apache License, Version 2.0
|
4
|
-
#
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
-
# you may not use this file except in compliance with the License.
|
7
|
-
# You may obtain a copy of the License at
|
8
|
-
#
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
#
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
# See the License for the specific language governing permissions and
|
15
|
-
# limitations under the License.
|
16
|
-
#
|
17
|
-
|
18
|
-
require "chef-dk/command/generator_commands/base"
|
19
|
-
|
20
|
-
module ChefDK
|
21
|
-
module Command
|
22
|
-
module GeneratorCommands
|
23
|
-
|
24
|
-
# ## App
|
25
|
-
# chef generate app path/to/basename --generator-cookbook=path/to/generator
|
26
|
-
#
|
27
|
-
# Generates a full "application" directory structure.
|
28
|
-
class App < Base
|
29
|
-
|
30
|
-
banner "Usage: chef generate app NAME [options]"
|
31
|
-
|
32
|
-
attr_reader :errors
|
33
|
-
attr_reader :app_name_or_path
|
34
|
-
|
35
|
-
options.merge!(SharedGeneratorOptions.options)
|
36
|
-
|
37
|
-
def initialize(params)
|
38
|
-
@params_valid = true
|
39
|
-
@app_name = nil
|
40
|
-
super
|
41
|
-
end
|
42
|
-
|
43
|
-
def run
|
44
|
-
read_and_validate_params
|
45
|
-
if params_valid?
|
46
|
-
setup_context
|
47
|
-
chef_runner.converge
|
48
|
-
else
|
49
|
-
err(opt_parser)
|
50
|
-
1
|
51
|
-
end
|
52
|
-
rescue ChefDK::ChefRunnerError => e
|
53
|
-
err("ERROR: #{e}")
|
54
|
-
1
|
55
|
-
end
|
56
|
-
|
57
|
-
def setup_context
|
58
|
-
super
|
59
|
-
Generator.add_attr_to_context(:app_root, app_root)
|
60
|
-
Generator.add_attr_to_context(:app_name, app_name)
|
61
|
-
Generator.add_attr_to_context(:cookbook_root, cookbook_root)
|
62
|
-
Generator.add_attr_to_context(:cookbook_name, cookbook_name)
|
63
|
-
Generator.add_attr_to_context(:recipe_name, recipe_name)
|
64
|
-
end
|
65
|
-
|
66
|
-
def recipe
|
67
|
-
"app"
|
68
|
-
end
|
69
|
-
|
70
|
-
def recipe_name
|
71
|
-
"default"
|
72
|
-
end
|
73
|
-
|
74
|
-
def app_name
|
75
|
-
File.basename(app_full_path)
|
76
|
-
end
|
77
|
-
|
78
|
-
def app_root
|
79
|
-
File.dirname(app_full_path)
|
80
|
-
end
|
81
|
-
|
82
|
-
def cookbook_root
|
83
|
-
File.join(app_full_path, "cookbooks")
|
84
|
-
end
|
85
|
-
|
86
|
-
def cookbook_name
|
87
|
-
app_name
|
88
|
-
end
|
89
|
-
|
90
|
-
def app_full_path
|
91
|
-
File.expand_path(app_name_or_path, Dir.pwd)
|
92
|
-
end
|
93
|
-
|
94
|
-
def read_and_validate_params
|
95
|
-
arguments = parse_options(params)
|
96
|
-
@app_name_or_path = arguments[0]
|
97
|
-
@params_valid = false unless @app_name_or_path
|
98
|
-
end
|
99
|
-
|
100
|
-
def params_valid?
|
101
|
-
@params_valid
|
102
|
-
end
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
@@ -1,87 +0,0 @@
|
|
1
|
-
context = ChefDK::Generator.context
|
2
|
-
app_dir = File.join(context.app_root, context.app_name)
|
3
|
-
cookbooks_dir = context.cookbook_root
|
4
|
-
cookbook_dir = File.join(cookbooks_dir, context.cookbook_name)
|
5
|
-
|
6
|
-
# app root dir
|
7
|
-
directory app_dir
|
8
|
-
|
9
|
-
# Top level files
|
10
|
-
|
11
|
-
# Test Kitchen
|
12
|
-
template "#{app_dir}/kitchen.yml" do
|
13
|
-
source 'kitchen.yml.erb'
|
14
|
-
helpers(ChefDK::Generator::TemplateHelper)
|
15
|
-
end
|
16
|
-
|
17
|
-
# Inspec
|
18
|
-
directory "#{app_dir}/test/integration/default" do
|
19
|
-
recursive true
|
20
|
-
end
|
21
|
-
|
22
|
-
template "#{app_dir}/test/integration/default/default_test.rb" do
|
23
|
-
source 'inspec_default_test.rb.erb'
|
24
|
-
helpers(ChefDK::Generator::TemplateHelper)
|
25
|
-
action :create_if_missing
|
26
|
-
end
|
27
|
-
|
28
|
-
# README
|
29
|
-
template "#{app_dir}/README.md" do
|
30
|
-
helpers(ChefDK::Generator::TemplateHelper)
|
31
|
-
end
|
32
|
-
|
33
|
-
# Generated Cookbook:
|
34
|
-
|
35
|
-
# cookbook collection dir
|
36
|
-
directory cookbooks_dir
|
37
|
-
|
38
|
-
# cookbook collection dir
|
39
|
-
directory cookbook_dir
|
40
|
-
|
41
|
-
# metadata.rb
|
42
|
-
template "#{cookbook_dir}/metadata.rb" do
|
43
|
-
helpers(ChefDK::Generator::TemplateHelper)
|
44
|
-
end
|
45
|
-
|
46
|
-
# chefignore
|
47
|
-
cookbook_file "#{cookbook_dir}/chefignore"
|
48
|
-
|
49
|
-
# Berks
|
50
|
-
cookbook_file "#{cookbook_dir}/Berksfile"
|
51
|
-
|
52
|
-
# Recipes
|
53
|
-
|
54
|
-
directory "#{cookbook_dir}/recipes"
|
55
|
-
|
56
|
-
template "#{cookbook_dir}/recipes/default.rb" do
|
57
|
-
source 'recipe.rb.erb'
|
58
|
-
helpers(ChefDK::Generator::TemplateHelper)
|
59
|
-
end
|
60
|
-
|
61
|
-
# Chefspec
|
62
|
-
directory "#{cookbook_dir}/spec/unit/recipes" do
|
63
|
-
recursive true
|
64
|
-
end
|
65
|
-
|
66
|
-
cookbook_file "#{cookbook_dir}/spec/spec_helper.rb" do
|
67
|
-
action :create_if_missing
|
68
|
-
end
|
69
|
-
|
70
|
-
template "#{cookbook_dir}/spec/unit/recipes/default_spec.rb" do
|
71
|
-
source 'recipe_spec.rb.erb'
|
72
|
-
helpers(ChefDK::Generator::TemplateHelper)
|
73
|
-
action :create_if_missing
|
74
|
-
end
|
75
|
-
|
76
|
-
# git
|
77
|
-
if context.have_git
|
78
|
-
unless context.skip_git_init
|
79
|
-
execute('initialize-git') do
|
80
|
-
command('git init .')
|
81
|
-
cwd app_dir
|
82
|
-
end
|
83
|
-
end
|
84
|
-
cookbook_file "#{app_dir}/.gitignore" do
|
85
|
-
source 'gitignore'
|
86
|
-
end
|
87
|
-
end
|