Skip to content

Instantly share code, notes, and snippets.

@bpholt
Last active February 14, 2017 21:54
Show Gist options
  • Save bpholt/5230644 to your computer and use it in GitHub Desktop.
Save bpholt/5230644 to your computer and use it in GitHub Desktop.
Puppet Module Syntax Check, Lint, Run Tests, and ERB Syntax Check. There is almost certainly a better way to do this.
#!/bin/bash
# Run from the base directory of your Puppet module
echo ===================
echo Parser Validation
echo ===================
find . -name "*.pp" | xargs -n 1 -t puppet parser validate
echo ===================
echo Linting
echo ===================
find . -name "*.pp" | xargs -n 1 -t puppet-lint
echo ===================
echo Applying Tests
echo ===================
find tests -name "*.pp" | xargs -n 1 -t puppet apply --noop
echo ===================
echo Checking ERB Syntax
echo ===================
find . -name "*.erb" | xargs -n 1 -t -I \{\} erb -P -x -T '-' \{\} | ruby -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment