如何解决git post-receive hook 不触发 Jenkins 作业机器 1:本地,机器 2:远程
在 Remote 中使用 git post-receive hook 触发 Jenkins Job 时遇到问题。请需要输入。
一切正常:
同一台机器:本地和远程
远程触发器 Jenkins 作业中的 post-receive 钩子
Git 轮询日志
中的更新
构建触发器 - 轮询 SCM
问题条件:
机器 1:本地,机器 2:远程
Remote 中的 post-receive 钩子不会触发 Jenkins 作业
Git 轮询日志
中没有更新
构建触发器 - 轮询 SCM
如果从 Machine-1 浏览器执行 http://machine-2:8080/git/notifyCommit?url=file://D:\GitServer.git
,Remote 中的 post-receive 钩子会触发 machine-2 中的 Jenkins 作业。
观察:当从机器 1 执行 git push 时,机器 2 中的 Jenkins 作业没有被触发。
注意:在两台机器上都使用 tortoisegit。
接收后挂钩:
#!/usr/bin/env python
from subprocess import check_output
if __name__ == '__main__':
log = check_output([
'curl','-X','POST','http://localhost:8080/git/notifyCommit?url=file://D:\GitServer.git'
])
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。