Skip to content

Commit b169202

Browse files
authored
g10k validation (#8)
Also allow `g10k` for pre-commit hooks
1 parent 7ec1568 commit b169202

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

pre-receive

+17
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,23 @@ while read -r oldrev newrev refname; do
155155
echo "puppet-lint not installed. Skipping puppet-lint tests..."
156156
fi
157157
fi
158+
159+
# g10k validation
160+
if [[ "$CHECK_G10K" != "disabled" ]] ; then
161+
if hash g10k >/dev/null 2>&1; then
162+
if [[ "$changedfile" = "Puppetfile" ]]; then
163+
printf "running g10k validation on $tmptree/Puppetfile... "
164+
if g10k -validate -puppetfilelocation "$tmptree/Puppetfile"; then
165+
echo "ok"
166+
else
167+
failures=$((failures + 1))
168+
fi
169+
fi
170+
else
171+
echo "g10k not installed. Skipping g10k Puppetfile test..."
172+
fi
173+
fi
174+
158175
#r10k puppetfile syntax check
159176
if [[ "$CHECK_R10K" != "disabled" ]] ; then
160177
if hash r10k >/dev/null 2>&1; then

0 commit comments

Comments
 (0)