Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,298,613
Community Members
 
Community Events
165
Community Groups

Different merging strategy for release branches in Bamboo Specs

I have been trying to create a bamboo.yaml that both creates new plan branches for pull requests and plan branches for all release/.* branches.

Is it possible to create a specification that has different integration for different plan branches?


branches:
    create:
        for-new-branch: release/.*
    delete:
        after-deleted-days: 14
        after-inactive-days: 14

 

branches: 
    createfor-pull-request
    
integration:
       
merge-from${bamboo.repository.pr.targetBranch}
        
push-on-successfalse
    link-to-jira: true
    

 

I don't want the release branches to merge with anything when built but plan branches from PRs should always be merged with the target branch.

1 answer

0 votes
Charlie Misonne Community Leader Nov 12, 2020

Hi Andreas

I'm looking for the same thing. Did you find any solution?

I never did. We reverted back and are not using specs anymore.

Charlie Misonne Community Leader Nov 12, 2020

Oh ok. After digging deeper today I found Bamboo 7.1 supports branch overriding for several things including branch-config -> integration.

https://docs.atlassian.com/bamboo-specs-docs/7.1.4/specs.html?yaml#overriding-branch-settings-using-bamboo-specs

I have to update to Bamboo 7.1 so I haven't tested yet.

Did anyone get this to work? I want exactly the same thing.

Normal development branches are created by pull-request, and those have a merge strategy. But a release branch should be created just from a named branch, and it should not merge.

I have created the YAML spec from how I understand it should be, but it doesn't do anything.

branches:
create: for-pull-request
delete:
after-deleted-days: 0
after-inactive-days: 60
integration:
push-on-success: false
merge-from: core-build
link-to-jira: true
branch-overrides:
-
^test_.*$:
branch-config:
create:
for-new-branch: ^test_.*$
delete:
after-deleted-days: 0
after-inactive-days: 5
link-to-jira: true

I create a branch in git matching the regex, but I still don't get any branch appearing automatically.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo Data Center on Kubernetes

Hi, If you are running self-managed environments and looking to adopt modern infrastructure, Bamboo Data Center can now be deployed in a Kubernetes cluster. By leveraging Kubernetes, you can easily...

963 views 3 8
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you