使用git webhook触发多分支Jenkins流水线作业无效

4

我有一个多分支流水线作业,配置如下:

Job Config

轮询也为其配置了:

Poll Config

当配置的Git存储库推送新提交后,在轮询后,作业会按预期触发。在控制台输出中,Git存储库记录为https://stash.example.com/scm/eg/project.git。然而,当我尝试使用git notifyCommit webhook触发作业时,我收到了这个错误消息:
$ curl 'http://jenkins.example.com/git/notifyCommit?url=https://stash.example.com/scm/eg/project.git'
No git jobs using repository: https://stash.example.com/scm/eg/project.git and branches:
No Git consumers using SCM API plugin for: https://stash.example.com/scm/eg/project.git

这里缺少什么?为什么Jenkins找不到该存储库的任何工作/ git消费者来触发它?
1个回答

0
你收到该错误的原因是在作业配置中使用了BitBucket插件,因此您不能使用curl请求获取通知端点来触发构建。此外,GitNotify端点是Github插件的一部分,它扫描所有使用GitPlugin的作业配置,然后将curl请求的URL与git插件中使用的repo的URL进行交叉匹配。因此,如果您想使用Bitbucket,则请按照https://mohamicorp.atlassian.net/wiki/spaces/DOC/pages/381419546/Configuring+Webhook+To+Jenkins+for+Bitbucket+Bitbucket+Branch+Source+Plugin上记录的说明进行操作。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接