puppet-dev-tools
puppet-dev-tools is a container image provided by Puppet and shipped with Continuous Delivery (CD) that contains a suite of tools to help you test your Puppet code:
The CD installer pushes a tarball containing the latest published version of puppet-dev-tools to the CD host at /etc/puppetlabs/cd4pe/default_job_image/gcr.io_platform-services-297419_puppet-dev-tools_${CD_VERSION}.tar.gz. If your job hardware node doesn’t have internet access, you can install puppet-dev-tools from this tarball.
If you are testing Puppet 8 code or later, use gcr.io/platform-services-297419/puppet-dev-tools:puppet8. This is the default image that ships with CD 5.13.0 and later. If you find that you’re running into compatibility issues with your Puppet 7 code, try using gcr.io/platform-services-297419/puppet-dev-tools:puppet7 which comes with PDK 3.5.0.
Available Commands
-
PDK: see the PDK command reference for details
-
Onceover: see Onceover's readme for details
-
Rake: see the following table for tasks from the installed gems
| Command | Description |
|---|---|
rake check
|
Run static pre-release checks |
rake check:dot_underscore
|
Fails if any ._ files are present in directory |
rake check:git_ignore
|
Fails if directories contain the files specified in .gitignore |
rake check:symlinks
|
Fails if symlinks are present in directory |
rake check:test_file
|
Fails if .pp files present in tests folder |
rake check_for_spec_tests
|
Get spec test status |
rake compute_dev_version
|
Print development version of module |
rake generate_fixtures
|
Writes a fixtures.yml file based on the Puppetfile / Generate Fixtures files for role/profile
|
rake generate_spec_tests
|
Generate spec tests for missing classes |
rake help
|
Display the list of available rake tasks |
rake hiera_setup
|
Modifies your hiera.yaml to point at the hieradata relative to its position |
rake lint
|
Run puppet-lint |
rake lint_fix
|
Run puppet-lint |
rake parallel_spec
|
Run spec tests in parallel and clean the fixtures directory if successful |
rake parallel_spec_standalone
|
Parallel spec tests |
rake pe_only_mods
|
Show Puppet Enterprise Only Modules |
rake r10k:dependencies
|
Print outdated forge modules |
rake r10k:deprecation
|
Validate that no forge modules are deprecated |
rake r10k:diff[branch_a,branch_b]
|
Check for module differences between two branches of a Puppetfile |
rake r10k:duplicates
|
Check Puppetfile for duplicates |
rake r10k:install
|
Install modules specified in Puppetfile |
rake r10k:print_git_conversion
|
Convert and print forge modules to Git format |
rake r10k:solve_dependencies[allow_major_bump]
|
Find missing or outdated module dependencies |
rake r10k:syntax
|
Syntax check Puppetfile |
rake r10k:validate
|
Validate the Git URLs, branches, refs, or tags |
rake release_checks
|
Runs all necessary checks on a module in preparation for a release |
rake rubocop
|
Run RuboCop |
rake rubocop:autocorrect
|
Autocorrect RuboCop offenses (only when it's safe) |
rake rubocop:autocorrect_all
|
Autocorrect RuboCop offenses (safe and unsafe) |
rake run_tests
|
Run tests |
rake spec
|
Run spec tests and clean the fixtures directory if successful |
rake spec:simplecov
|
Run spec tests with Ruby simplecov code coverage |
rake spec_clean
|
Clean up the fixtures directory |
rake spec_clean_symlinks
|
Clean up any fixture symlinks |
rake spec_list_json
|
List spec tests in a JSON document |
rake spec_prep
|
Create the fixtures directory |
rake spec_standalone
|
Run RSpec code examples |
rake strings:generate[patterns,debug,backtrace,markup,json,markdown,yard_args]
|
Generate Puppet documentation with YARD |
rake strings:generate:reference[patterns,debug,backtrace]
|
Generate Puppet Reference documentation |
rake strings:gh_pages:update
|
Update docs on the gh-pages branch and push to GitHub |
rake strings:validate:reference[patterns,debug,backtrace]
|
Validate the reference is up to date |
rake syntax
|
Syntax check for Puppet manifests, templates and Hiera |
rake syntax:hiera
|
Syntax check Hiera config files |
rake syntax:manifests
|
Syntax check Puppet manifests |
rake syntax:templates
|
Syntax check Puppet templates |
rake validate
|
Check syntax of Ruby files and call :syntax and :metadata_lint |
rake yamllint
|
Run yamllint |