Jenkins 未由 github-webhook 触发
Jenkins not triggered by github-webhook
我已经采取了这些步骤:
- 选中"GitHub project"并设置项目
- 勾选"GitHub hook trigger for GITScm polling"
- 使用 user/password
设置与私有存储库的连接
- 如果我手动构建,它可以工作
- 在 GitHub 中,在推送到 http://my_jenkins_url/github-webhook/
时创建一个 webhook
- 每当我提交某些内容时,它都会显示已发送 webhook 并且我会收到 200 响应代码(在 github 上)
但是在 Jenkins 上没有触发构建。 GitHub 挂钩日志说:"Polling has not run yet."。我怎样才能做到"start"?我该如何进一步调试它?
编辑:我没有在 Manage Jenkins -> Configure -> GitHub 中添加 GitHub 服务器,因为我 运行 遇到身份验证问题(但这会有所不同题)。 github webhook 需要这样做吗?
EDIT2:我想出了如何将 GitHub API 添加到 Jenkins 配置(使用启用了 git 挂钩访问的个人访问令牌)。不过好像没什么区别。
我找到了正确修复它的方法。
第一。在 Jenkins manage > system log
设置 Jenkins 记录器
添加日志记录器,使用此配置
hudson.plugins.git.GitStatus - All
com.cloudbees.jenkins.GitHubWebHook - All
org.jenkinsci.plugins.github - All
第二。钩子再次触发。
并再次检查记录器。在我的例子中,记录器说
Skipped {ProjectName} because it doesn't have a matching repository.
第三。检查 webhook url webhook 请求的确切来源。
它将在记录器中指定如下:
Received PushEvent for https://github.com/{username}/{reponame} from {ip} ⇒ http://{your jenkins url}/github-webhook/
第四。再次进入jenkins项目配置,
检查整个 github urls 与步骤 3 中的 https://github.com/{username}/{reponame} 完全相同。
没有。git 最后。
希望这个回答对您有所帮助。谢谢
我已经采取了这些步骤:
- 选中"GitHub project"并设置项目
- 勾选"GitHub hook trigger for GITScm polling"
- 使用 user/password 设置与私有存储库的连接
- 如果我手动构建,它可以工作
- 在 GitHub 中,在推送到 http://my_jenkins_url/github-webhook/ 时创建一个 webhook
- 每当我提交某些内容时,它都会显示已发送 webhook 并且我会收到 200 响应代码(在 github 上)
但是在 Jenkins 上没有触发构建。 GitHub 挂钩日志说:"Polling has not run yet."。我怎样才能做到"start"?我该如何进一步调试它?
编辑:我没有在 Manage Jenkins -> Configure -> GitHub 中添加 GitHub 服务器,因为我 运行 遇到身份验证问题(但这会有所不同题)。 github webhook 需要这样做吗?
EDIT2:我想出了如何将 GitHub API 添加到 Jenkins 配置(使用启用了 git 挂钩访问的个人访问令牌)。不过好像没什么区别。
我找到了正确修复它的方法。
第一。在 Jenkins manage > system log
设置 Jenkins 记录器添加日志记录器,使用此配置
hudson.plugins.git.GitStatus - All
com.cloudbees.jenkins.GitHubWebHook - All
org.jenkinsci.plugins.github - All
第二。钩子再次触发。
并再次检查记录器。在我的例子中,记录器说
Skipped {ProjectName} because it doesn't have a matching repository.
第三。检查 webhook url webhook 请求的确切来源。
它将在记录器中指定如下:
Received PushEvent for https://github.com/{username}/{reponame} from {ip} ⇒ http://{your jenkins url}/github-webhook/
第四。再次进入jenkins项目配置,
检查整个 github urls 与步骤 3 中的 https://github.com/{username}/{reponame} 完全相同。
没有。git 最后。
希望这个回答对您有所帮助。谢谢