我正在使用木偶钩。
但是,在我的本地机器上安装了puppet-lint,但是当我执行git push origin puppet_hook时,会得到以下输出:
Compressing objects: 100% (2/2), done.
Writing objects: 100% (4/4), 345 bytes | 0 bytes/s, done.
Total 4 (delta 1), reused 0 (delta 0)
remote: Checking puppet manifest syntax for manifests/init.pp...
remote: Error: Could not parse for environment production: Syntax error at '}' at manifests/init.pp:3
remote: Error: puppet syntax error in manifests/init.pp (see above)
remote: Error: 1 syntax error(s) found in puppet manifests. Commit will be aborted.
remote: puppet-lint not installed. Skipping puppet-lint tests...
remote: Error: 1 subhooks failed. Declining push.
remote: Hook /var/tmp/hooks/pre-receive.puppet failed with error code 1正如你所看到的,它说:
remote: puppet-lint not installed. Skipping puppet-lint tests...
当我跟踪它到预接收脚本(上面提供的)时,我发现了以下检查:
#puppet manifest styleguide compliance
if [ "$CHECK_PUPPET_LINT" != "disabled" ] ; then
if type puppet-lint >/dev/null 2>&1; then
if [ $(echo $changedfile | grep -q '\.*.pp$' ; echo $?) -eq 0 ]; then
${subhook_root}/puppet_lint_checks.sh $CHECK_PUPPET_LINT $tmpmodule "${tmptree}/"
RC=$?
if [ "$RC" -ne 0 ]; then
failures=`expr $failures + 1`
fi
fi
else
echo "puppet-lint not installed. Skipping puppet-lint tests..."
fi
fi它似乎在以下方面失败:
if type puppet-lint >/dev/null 2>&1; then
当我在本地运行上面的命令时,它是成功的。
为什么不通过预接收脚本检测puppet-lint?
发布于 2015-07-08 21:31:09
检查你要去的服务器。您正在运行的用户可能没有设置别名,或者路径中有puppet-lint。
https://stackoverflow.com/questions/31282801
复制相似问题