【发布时间】:2018-07-19 17:39:23
【问题描述】:
我在接收后挂钩和 Jenkins 集成方面遇到问题。 我在 GIT 存储库的 hooks 目录中添加了一个名为 post-receive 的文件。文件内容为:
#!C:/Program\ Files/Git/usr/bin/sh.exe
echo "Post-receive started..."
curl.exe --user Jakob:tempPassword --url "http://localhost:8080/job/TestJob/build?token=ebcc64cb8315211c5287b20b3fdd7190"
echo "Post-receive ended..."
在 Jenkins 方面,我有一份工作就是为了这个令牌。 我在 Windows 10 机器上运行 Jenkins 和 GIT-repos。
现在解决问题。如果我在 git bash shell 中本地执行上述命令,则所有内容都会执行并启动 Jenkins 构建。一切都很好。
如果我向 GIT-repo 提交/推送某些内容,我可以看到 post-receive-hook 已执行(正如我在 tortoisegit 窗口中看到的那样),但 jenkins 作业没有执行!
可能是什么问题?
【问题讨论】: