问题描述
我是竹子和网络钩子的新手.当我尝试从我的仓库中打开主分支的PR时,我正在尝试自动启动Bamboo构建.
I'm new to bamboo and webhooks. I'm trying to start a bamboo build automatically when a PR to master branch from my repo is opened.
我关注了本指南,但远程触发器根本没有启动.
I followed this guide but the remote trigger is not starting at all.
竹:
BitBucket:
我已经检查了以下内容:
I've already checked the following:
-
验证列入白名单的ip正确(如果我删除了该位,则bitbucket webhook将失败)
verify that the whitelisted ip is correct (the bitbucket webhook fails if i remove that)
我的竹计划已启用,并且在手动运行时运行良好
my bamboo plan is enabled and is building fine on manual run
我想念什么?
YAML中的竹编构建计划:
---
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
...
============================================== ==============================
好的,所以我意识到了钩子和触发器实际上是起作用的.我误解了竹子上的扳机设置.
Okay, so I realized the hook and the trigger is actually working. I misunderstood the trigger setup on bamboo.
当前行为:
- 母版PR已打开
- 已触发BitBucket Webhook(在PR上)
- Bamboo触发器设置为远程/Bitbucket服务器存储库.因此,在提交更改/PR实际合并之前,构建将不会开始
- PR to master is opened
- BitBucket webhook (on PR) is fired
- Bamboo trigger is set to remote / bitbucket server repo. Because of this, the build will not start until the changes are commited / PR is actually merged
问题:我希望PR打开后(合并之前)触发构建.在更多情况下,这是我构建的理想流程:
Problem:I want the build to trigger once the PR is opened (before merge). To a bit more context, this is the ideal flow of my build:
- 签出PR代码(修订版)
- 针对PR版本运行测试
- Checkout the PR code (revision)
- Run my tests against the PR revision
我正在查看以下链接,因为它们似乎设法以某种方式做到了,但我无法理解两个链接中提供的信息.
I'm looking at the following links as it seems they managed to do it somehow but I can't make sense of the bits of info provided in both the links.
推荐答案
发现从Bamboo 6+开始,此功能即刻受支持:参考
Found out that this feature is supported out of the box as of Bamboo 6+: Reference
这篇关于仅在PR上从BitBucket Server Webhook进行远程触发Bamboo构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!