Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix r10k check #105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions commit_hooks/r10k_syntax_check.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/bin/bash
#
# This script assumes you have installed r10k and will perform a syntax check on the Puppetfile if existing
old_dir=$PWD
pf_dir=$(dirname $1)

echo "Performing a syntax check on the r10k Puppetfile:"
PUPPETFILE="$1" r10k puppetfile check
cd $pf_dir && r10k puppetfile check

if [[ $? -ne 0 ]]
then
exit 1
cd $old_dir
exit 1
fi

cd $old_dir
exit 0