代码之家  ›  专栏  ›  技术社区  ›  Elazar

Jenkins管道不是由Bitbucket服务器推送/PR触发的,但freestyle项目触发了

  •  0
  • Elazar  · 技术社区  · 2 年前

    我正在配置Jenkins设置,每次在Bitbucket服务器存储库上发出推送或拉取请求时,都应该触发一个管道。有趣的是,这种设置可以无缝地用于自由式项目,但它似乎不能用于管道项目。

    以下是我的配置:

    • 詹金斯版本:2.427
    • Bitbucket服务器:8.14.1

    插件:

    • Bitbucket推拉请求:2.8.4
    • Git插件:5.2.0

    在我的配置中,我选择的唯一选项如下所示 screenshot 。对于源代码管理(SCM),我使用的是Git。当我测试连接时,我会收到以下消息:

    Jenkins成功连接到主服务器上的bitbucketmanaged的Jenkins/sample

    Bitbucket端的webhook也设置正确,我已经确认它在到达自定义端点时返回200 OK状态。

    然而,这里有一个异常:当我试图将更改从暂存分支合并到主分支时,它会触发一个自由式项目,但不会触发管道项目。

    以下是我迄今为止在詹金斯日志中发现的内容

    enter image description here

    正如你所看到的,webhook本身确实触发了 enter image description here

    Bitbucket日志

    2023-10-11 08:08:08,438 DEBUG [http-nio-7990-exec-5] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.p.InternalPullRequestCommitHelper Indexing: linking PR 3070 with 26 commit(s) using include: 6c880405f0d63e97b54d3ce080bba38383618e03
    2023-10-11 08:08:08,484 DEBUG [http-nio-7990-exec-5] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.e.TransactionAwareEventPublisher Deferring publishing for WatcherAddedEvent until AFTER_COMMIT
    2023-10-11 08:08:08,484 DEBUG [http-nio-7990-exec-5] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.e.TransactionAwareEventPublisher Deferring publishing for PullRequestActivityEvent until AFTER_COMMIT
    2023-10-11 08:08:08,484 DEBUG [http-nio-7990-exec-5] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.e.TransactionAwareEventPublisher Deferring publishing for AnalyticsPullRequestOpenedEvent until AFTER_COMMIT
    2023-10-11 08:08:08,532 DEBUG [http-nio-7990-exec-5] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.e.TransactionAwareEventPublisher Publishing WatcherAddedEvent after commit
    2023-10-11 08:08:08,532 DEBUG [http-nio-7990-exec-5] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.e.TransactionAwareEventPublisher Publishing PullRequestActivityEvent after commit
    2023-10-11 08:08:08,532 DEBUG [http-nio-7990-exec-5] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.e.TransactionAwareEventPublisher Publishing AnalyticsPullRequestOpenedEvent after commit
    2023-10-11 08:08:08,533 DEBUG [threadpool:thread-2] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.n.DefaultNotificationManager Managing notification: PullRequestActivityNotification{admin=InternalNormaladmin{id=753, adminname=admin}, timestamp=Wed Oct 11 08:08:08 IDT 2023, pullRequest=jenkins:9, activity=InternalPullRequestActivity{id=66284, admin=InternalNormaladmin{id=753, adminname=admin}, action=OPENED, pullRequest.id=9}}
    2023-10-11 08:08:08,533 DEBUG [AtlassianEvent::thread-3] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.e.r.impl.RemoteEventListener Queueing RemoteEvent com.atlassian.stash.plugin.remote.event.StashPullRequestOpenedRemoteEvent@c9decd7[fromBranch=refs/heads/main,fromProjectKey=JENKINS,fromRepositorySlug=jenkins,id=9,toBranch=refs/heads/master,toProjectKey=JENKINS,toRepositorySlug=jenkins,sourceId=<null>,sourceUrl=<null>]
    2023-10-11 08:08:08,533 DEBUG [threadpool:thread-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.n.DefaultNotificationManager Managing notification: PullRequestOpenedNotification{admin=InternalNormaladmin{id=753, adminname=admin}, timestamp=Wed Oct 11 08:08:08 IDT 2023, pullRequest=jenkins:9}
    2023-10-11 08:08:08,534 DEBUG [AtlassianEvent::thread-3] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.e.r.impl.RemoteEventDispatcher RemoteEvent com.atlassian.stash.plugin.remote.event.StashPullRequestOpenedRemoteEvent@c9decd7[fromBranch=refs/heads/main,fromProjectKey=JENKINS,fromRepositorySlug=jenkins,id=9,toBranch=refs/heads/master,toProjectKey=JENKINS,toRepositorySlug=jenkins,sourceId=<null>,sourceUrl=<null>] consumable by []
    2023-10-11 08:08:08,534 DEBUG [AtlassianEvent::thread-3] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.e.r.impl.RemoteEventListener Batch size not exceeded for com.atlassian.stash.plugin.remote.event.StashPullRequestOpenedRemoteEvent@c9decd7[fromBranch=refs/heads/main,fromProjectKey=JENKINS,fromRepositorySlug=jenkins,id=9,toBranch=refs/heads/master,toProjectKey=JENKINS,toRepositorySlug=jenkins,sourceId=<null>,sourceUrl=<null>]
    2023-10-11 08:08:08,534 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.m.b.listener.AbstractEventListener Creating Event for: com.atlassian.stash.internal.pull.AnalyticsPullRequestOpenedEvent[source=com.atlassian.stash.internal.pull.DefaultPullRequestService@2bad091d]
    2023-10-11 08:08:08,535 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.bitbucket.service.LicenseManager Plugin licensed.
    2023-10-11 08:08:08,535 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.AbstractProcessor isEventAccepted for event type: PULL_REQUEST_OPENED, and result is true, class : PullRequestProcessor
    2023-10-11 08:08:08,535 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.PullRequestProcessor isEventAccepted for event type: PULL_REQUEST_OPENED
    2023-10-11 08:08:08,535 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.PullRequestProcessor isEventAccepted result: true
    2023-10-11 08:08:08,535 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.m.b.listener.AbstractEventListener nl.topicus.bitbucket.processor.PullRequestProcessor accepted event by type: PULL_REQUEST_OPENED
    2023-10-11 08:08:08,535 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.PullRequestProcessor Processing event with type: PULL_REQUEST_OPENED
    2023-10-11 08:08:08,535 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.PullRequestProcessor sendPullRequestEvent: PULL_REQUEST_OPENED
    2023-10-11 08:08:08,614 DEBUG [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.s.g.m.MeshPullRequestRefHelper JENKINS/jenkins[203]: Pull request 9@0 merged automatically without conflicts
    2023-10-11 08:08:08,627 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.PullRequestProcessor sendPullRequestEvent prUrl: http://192.168.200.23:7990/projects/JENKINS/repos/jenkins/pull-requests/9
    2023-10-11 08:08:08,627 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.AbstractProcessor sendEvents event type: PULL_REQUEST_OPENED
    2023-10-11 08:08:08,628 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.AbstractProcessor sendEvents getting configuration for repo: 203
    2023-10-11 08:08:08,629 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.s.WebhookConfigurationService Always add project configurations: false
    2023-10-11 08:08:08,629 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.s.WebhookConfigurationService Always add global configurations: false
    2023-10-11 08:08:08,629 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.AbstractProcessor sendEvents enabledWebHookConfigurations count: 0
    2023-10-11 08:08:08,629 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.bitbucket.service.LicenseManager Plugin licensed.
    2023-10-11 08:08:08,629 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.AbstractProcessor isEventAccepted for event type: PULL_REQUEST_OPENED, and result is false, class : RepositoryRefsChangedProcessor
    2023-10-11 08:08:08,629 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.bitbucket.service.LicenseManager Plugin licensed.
    2023-10-11 08:08:08,629 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.AbstractProcessor isEventAccepted for event type: PULL_REQUEST_OPENED, and result is false, class : BuildStatusSetProcessor
    2023-10-11 08:08:08,629 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.p.ProjectRepositoryModificationProcessor Event PULL_REQUEST_OPENED accepted: false
    2023-10-11 08:08:08,629 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.bitbucket.service.LicenseManager Plugin licensed.
    2023-10-11 08:08:08,629 INFO  [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.AbstractProcessor isEventAccepted for event type: PULL_REQUEST_OPENED, and result is false, class : RepositoryMirrorSynchronizedProcessor
    2023-10-11 08:08:09,302 DEBUG [http-nio-7990-exec-6] admin @Y7JMOKx488x3200x0 hxbgmf 10.212.134.101 "GET /projects/JENKINS/repos/jenkins/pull-requests/9/overview HTTP/1.1" c.a.s.i.p.w.f.RequestCacheClientPageDataHandler Context bitbucket.web.repository.clone.dialog.options was required already. Ignoring.
    2023-10-11 08:08:10,225 DEBUG [http-nio-7990-exec-7] admin @Y7JMOKx488x3205x1 hxbgmf 10.212.134.101 "GET /rest/client-plugins/1.0/client-plugins/items HTTP/1.1" c.a.s.i.i18n.PluginI18nService No values found in any valid locale for key  and locales [en_US, en]
    2023-10-11 08:08:10,508 DEBUG [http-nio-7990-exec-2] admin @Y7JMOKx488x3211x0 hxbgmf 10.212.134.101 "GET /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests/9/activities HTTP/1.1" c.a.s.i.p.c.d.DriftCommentUpdateProcessor 203:9@0: No rescopes are pending drift
    2023-10-11 08:08:10,512 DEBUG [http-nio-7990-exec-4] admin @Y7JMOKx488x3213x2 hx
    

    是否有人面临过类似的问题,或者对如何解决这一问题有建议?

    0 回复  |  直到 2 年前
        1
  •  0
  •   Elazar    2 年前

    此插件需要安全连接。

    即通过端口443。

    向我的Bitbucket服务器颁发证书已经解决了这个问题。 enter image description here