我是 Bamboo 和 webhooks 的新手。当从我的 repo 中打开一个到 master 分支的 PR 时,我试图自动启动一个 Bamboo 构建。

我遵循了 this 指南,但远程触发器根本没有启动。

Bamboo :
bitbucket - 仅在 PR 上从 BitBucket Server webhook 远程触发 Bamboo 构建?-LMLPHP

比特桶:
bitbucket - 仅在 PR 上从 BitBucket Server webhook 远程触发 Bamboo 构建?-LMLPHP

我已经检查了以下内容:

  • 验证列入白名单的 ip 是否正确(如果我删除它,bitbucket webhook 将失败)
  • 我的 Bamboo 计划已启用并且在手动运行时构建良好

  • 我错过了什么?

    YAML 中的 Bamboo 构建计划:
    ---
    oid: 7818389690603565060
    key: XT
    name: XXX - TEMP
    project:
      oid: 7819374853022025730
      key: DIGQA
    repositories:
    - oid: 7818811903068661169
      parentRepository: 7818811903068661168
    triggers:
    - name: Bitbucket Server repository triggered
      description: ''
      pluginKey: com.atlassian.bamboo.plugins.stash.atlassian-bamboo-plugin-stash:stashTrigger
      enabled: true
      configuration: {}
      triggerConditions:
        com.atlassian.bamboo.triggercondition.internal:plansGreenCondition:
          enabled: 'false'
      triggeringRepositories:
      - 7818811903068661169
    - name: Remote trigger
      description: Master PR Trigger
      pluginKey: com.atlassian.bamboo.triggers.atlassian-bamboo-triggers:remote
      enabled: true
      configuration:
        repository.change.trigger.triggerIpAddress: 10.40.1.120
      triggerConditions:
        com.atlassian.bamboo.triggercondition.internal:plansGreenCondition:
          enabled: 'false'
      triggeringRepositories:
      - 7818811903068661169
    branchConfiguration:
      planBranchCreation:
        enabled: false
      removedBranchCleanup:
        enabled: false
      inactiveBranchesCleanup:
        enabled: false
      merging:
        enabled: false
      notificationStrategy: notifyCommitters
      triggers: inherited
      issueLinking: enabled
    dependencies:
      configuration:
        enabledForBranches: 'true'
        requireAllStagesPassing: null
        blockingStrategy: none
      childPlans: []
    permissions:
      users:
        xxxxxxxx:
        - administration
        - build
        - clone
        - read
        - write
      groups: {}
      roles:
        user:
        - read
        anonymous:
        - read
    plugins:
    - pluginKey: com.atlassian.bamboo.plugin.system.additionalBuildConfiguration:concurrentBuild
      configuration:
        custom.concurrentBuilds.overrideNumberOfConcurrentBuilds: 'true'
        custom.concurrentBuilds.numberOfConcurrentBuilds: '1'
    - pluginKey: com.atlassian.bamboo.plugin.system.additionalBuildConfiguration:buildExpiry
      configuration:
        custom.buildExpiryConfig.enabled: 'false'
    - pluginKey: com.atlassian.bamboo.plugin.artifact.handler.local:artifactHandlersConfiguration
      configuration:
        custom.artifactHandlers.useCustomArtifactHandlers: 'false'
    buildDefinition:
      custom.predefinedVariables: '{"variableSetList":[]}'
    stages:
    - oid: 7818530428091950756
      name: Default Stage
      jobs:
      - oid: 7818671165580276746
        key: JOB1
        name: Default Job
        tasks:
        - oid: 7819234115533708305
          description: Checkout Default Repository
          pluginKey: com.atlassian.bamboo.plugins.vcs:task.vcs.checkout
          configuration:
            repositories:
            - ref: defaultRepository
        buildDefinition:
          cleanWorkingDirectory: false
          repositoryDefiningWorkingDirectory: -1
    ...
    

    ================================================== ==========================

    编辑 1:

    好的,所以我意识到钩子(Hook)和触发器实际上在工作。我误解了 Bamboo 上的触发器设置。

    当前行为:
  • PR to master 已打开
  • BitBucket webhook(在 PR 上)被触发
  • Bamboo 触发器设置为远程/bitbucket 服务器存储库。因此,在提交更改/实际合并 PR 之前,构建不会开始

  • 问题:
    我希望在打开 PR 后(合并前)触发构建。在更多上下文中,这是我构建的理想流程:
  • checkout PR 代码(修订版)
  • 针对 PR 版本运行我的测试

  • 我正在查看以下链接,因为他们似乎以某种方式设法做到了,但我无法理解这两个链接中提供的信息。
  • bamboo - build my pull request
  • What's wrong with bamboo
  • 最佳答案

    由于您使用的是 Bamboo 和 Bitbucket Server(而非 Cloud),请按照此处的说明进行操作:

    https://confluence.atlassian.com/bamboo/integrating-bamboo-with-bitbucket-server-779302772.html

    您需要在 Bamboo 和 BBS 之间创建应用程序链接 - 应用程序链接位于 Atlassian 应用程序之间。

    关于bitbucket - 仅在 PR 上从 BitBucket Server webhook 远程触发 Bamboo 构建?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52509821/

    10-12 03:39