每当我的 Jenkins 收到有关我的存储库foo的新 git 提交的通知时,我都会在触发客户端上收到以下日志/错误响应:
Scheduled polling of foo
No git consumers for URI ssh://git@localhost:9777/path/to/foo.git
Run Code Online (Sandbox Code Playgroud)
这个失败的通知不会开始构建。使用手册“立即构建”开始成功构建。
localhost:8666.localhost:9777.ssh://git@localhost:9777/path/to/foo.git.hooks/post-receive包含内容的钩子文件:.
# this is file post-receive
curl http://localhost:8666/git/notifyCommit?url=ssh://git@localhost:9777/path/to/foo.git
Run Code Online (Sandbox Code Playgroud)
这种基于提交的通知过去运行良好。我有一种感觉,一旦我从标准 SSH 端口 22 移动到非标准 9777,它就会停止正常工作。
我该怎么做才能让提交通知导致构建触发器成功?
可能相关的源代码文件:
将钩子连接到 Jenkins 时要记住的事情:
Poll SCM将 Build Triggers 中的选项加厚,将“schedule”文本区域留空
该url=xxx参数必须与作业配置中指定的“存储库 URL”匹配。如果它以 ssh:// 为前缀,则应将其保留在通知调用中
别忘了push a change to the repo你配置!要验证您有更改:
http://jenkins-url:jenkins-port/job/JOB-NAME/scmPollLog/应在最后一行包含“找到的更改”。
来源:Git 插件文档
小智 -1
您不需要 ssh:// 部分。
尝试:
curl http://localhost:8666/git/notifyCommit?url=git@localhost:9777/path/to/foo.git
| 归档时间: |
|
| 查看次数: |
6059 次 |
| 最近记录: |