Skip to content

r10k ignores PUPPETFILE variable #110

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions commit_hooks/r10k_syntax_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
# This script assumes you have installed r10k and will perform a syntax check on the Puppetfile if existing

echo "Performing a syntax check on the r10k Puppetfile:"
PUPPETFILE="$1" r10k puppetfile check
pushd "$1" >/dev/null
r10k puppetfile check
RC=$?
popd >/dev/null

if [[ $? -ne 0 ]]
if [[ $RC -ne 0 ]]
then
exit 1
fi
4 changes: 2 additions & 2 deletions pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fi

# Only puppet 3.2.1 - 3.8 support "--parser future" option.
case $(puppet --version) in
4*) USE_PUPPET_FUTURE_PARSER="disabled" ;;
4*|5*) USE_PUPPET_FUTURE_PARSER="disabled" ;;
esac

SAVEIFS=$IFS
Expand Down Expand Up @@ -164,7 +164,7 @@ fi
#r10k puppetfile syntax check
if hash r10k >/dev/null 2>&1; then
if [[ "$changedfile" = "Puppetfile" ]]; then
"${subhook_root}/r10k_syntax_check.sh"
"${subhook_root}/r10k_syntax_check.sh" "${git_root}/"
RC=$?
if [[ "$RC" -ne 0 ]]; then
failures=$((failures + 1))
Expand Down
4 changes: 2 additions & 2 deletions pre-receive
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fi

# Only puppet 3.2.1 - 3.8 support "--parser future" option.
case $(puppet --version) in
4*) USE_PUPPET_FUTURE_PARSER="disabled" ;;
4*|5*) USE_PUPPET_FUTURE_PARSER="disabled" ;;
esac

while read -r oldrev newrev refname; do
Expand Down Expand Up @@ -150,7 +150,7 @@ while read -r oldrev newrev refname; do
#r10k puppetfile syntax check
if hash r10k >/dev/null 2>&1; then
if [ "$changedfile" = "Puppetfile" ]; then
${subhook_root}/r10k_syntax_check.sh $tmptree/$changedfile
${subhook_root}/r10k_syntax_check.sh "${tmptree}/"
RC=$?
if [ "$RC" -ne 0 ]; then
failures=`expr $failures + 1`
Expand Down