我正在尝试使用服务器端 Hook 在 Git 和 Rational Team Concert 之间实现一些策略。即预先收到一个,但那个钩子(Hook)似乎没有被解雇。 即使用一个简单的重命名文件的 bash shell 代替给定的理性钩子(Hook),这似乎也不会被执行。 我以 755 权限将脚本放在/hooks 目录下,如果从 shell 执行它可以正常工作。 我如何检查问题出在哪里? 我可以查看哪个日志?
这是我尝试作为预接收 Hook 执行的简单 shell
#!/bin/bash
#
# Licensed Materials - Property of IBM
# (c) Copyright IBM Corporation 2014. All Rights Reserved.
#
# Note to U.S. Government Users Restricted Rights:
# Use, duplication or disclosure restricted by GSA ADP Schedule
# Contract with IBM Corp.
#
#
z40=0000000000000000000000000000000000000000
IFS=' '
date >> /tmp/test.txt
#mv /tmp/ss/daeseguire.txt /tmp/ss/eseguito.txt
exit 1
提前致谢
最佳答案
不要忘记 pre-receive
钩子(Hook)是 server-side hook .
这意味着,如果您在 RTC 沙箱中嵌套了本地 git 存储库(这是 RTC 存储库工作区的本地 checkout ),则该本地 Git 存储库不会执行 。 git/hooks/pre-receive
脚本。
如果您设置了 RTC-Git integration ,那么官方文档就是“Configuring Git and Gerrit server-side hooks”。
但它假定 configuration step已完成并正在运行,这意味着您可以查看 Apache 日志以查看是否有任何线索。
关于Git 服务器端 Hook 未触发 - 如何检查,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42397299/