首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么git预接收钩没有探测到木偶皮棉?

为什么git预接收钩没有探测到木偶皮棉?
EN

Stack Overflow用户
提问于 2015-07-08 03:01:32
回答 1查看 510关注 0票数 0

我正在使用木偶钩

但是,在我的本地机器上安装了puppet-lint,但是当我执行git push origin puppet_hook时,会得到以下输出:

代码语言:javascript
复制
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...

当我跟踪它到预接收脚本(上面提供的)时,我发现了以下检查:

代码语言:javascript
复制
 #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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-07-08 21:31:09

检查你要去的服务器。您正在运行的用户可能没有设置别名,或者路径中有puppet-lint

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31282801

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档