我想在每次提交特定分支时配置Jenkins构建。我正在尝试使用 Bitbucket Webhook到Jenkins ,但它没有按照预期工作。要成功运行它,我需要在Jenkins作业中选择以下两个选项 1.将更改推送到BitBucket 时建立 和 2。轮询SCM(保持空白)
并在webhook中如下截图
当我取消忽略分支名称时,会出现以下错误。
它在日志中给出以下错误,并且不会在Jenkins中触发任何构建。
2017-07-28 19:18:49,382 ERROR [AtlassianEvent::thread-3] XXXXXXX @4NXRG4x1158x165x0 s2l8ua 10.229.17.70 "PUT /rest/api/latest/projects/STCPLAY/repos/mavensample/browse/pom.xml HTTP/1.1" c.a.s.i.e.AsyncBatchingInvokersTransformer There was an exception thrown trying to dispatch event 'com.atlassian.bitbucket.event.content.FileEditedEvent[source=com.atlassian.stash.internal.content.DefaultContentService@72ae21ba]' for the invoker 'SingleParameterMethodListenerInvoker{method=public void com.nerdwin15.stash.webhook.RepositoryChangeListener.onRefsChangedEvent(com.atlassian.bitbucket.event.repository.RepositoryRefsChangedEvent), listener=com.nerdwin15.stash.webhook.RepositoryChangeListener@356e810b}'
java.lang.RuntimeException: com.atlassian.bitbucket.repository.RefChange.getRefId()Ljava/lang/String;. Listener: com.nerdwin15.stash.webhook.RepositoryChangeListener event: com.atlassian.bitbucket.event.content.FileEditedEvent
at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:55)
at com.atlassian.stash.internal.event.AsyncBatchingInvokersTransformer$AsyncInvokerBatch.invoke(AsyncBatchingInvokersTransformer.java:109)
at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:38)
at com.atlassian.sal.core.executor.ThreadLocalDelegateRunnable.run(ThreadLocalDelegateRunnable.java:34)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.lang.Thread.run(Unknown Source)
... 1 frame trimmed
任何人都遇到过这个问题并修好了吗? 要么 还有其他更好的方法可以在特定分支上推送到bitbucket的提交上触发构建。
答案 0 :(得分:0)
一些建议:
Branches to build
)上的分支规范与您在BitBucket插件配置中Branch Options
中指定的分支相匹配。Build when a change is pushed to BitBucket
选项在这种情况下无关紧要。您可以在此处找到更详细的说明 - https://support.cloudbees.com/hc/en-us/articles/226568007-How-to-Trigger-Non-Multibranch-Jobs-from-BitBucket-Server-