Bamboo Build Plan Triggers

Himanshu Rawat August 20, 2019

Hi,

I am trying to use Bamboo Build Plan Triggers functionality for multiple repositories.

Below is the setup I have.

  1. Build Plan --> Plan Configuration --> Repositories ( Added three repositories ). All three are NOT converted to linked repository.
  2. Build Plan --> Plan Configuration --> Triggers.
    1. Added Trigger (Bitbucket Server repository triggered)
    2. Trigger configuration, checked all three repositories.
  3. Build Plan --> Plan Configuration --> Branches
    1. Create Plan Branch --> When new branch in repository is created

Below bitbucket activity is done on the 3rd repository which is configured as above

  1. Created a branch
  2. Committed and Pushed changes to that branch.

I expected as per above setup, a plan branch build should trigger but it isn't happening.

What's happening is any activity defined above, done on 1st repository works.

So the 'trigger' functionality only works for first repository.

My Goal:

To add multiple repositories (which is done) and configure triggers on all repositories to trigger the same build plan when some activity (such as commit on a branch) is done on the repositories..

Please assist

Atlassian Bamboo version 6.6.3 build 60607 - 25 Sep 18

Atlassian Bitbucket v5.7.0

Thanks,

Himanshu

1 answer

1 accepted

1 vote
Answer accepted
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 22, 2019

Hi @Himanshu Rawat

Bamboo plans will only create plan branches for the main repository. This is expected.
It is indeed a complex subject. If Bamboo created the branch as you expect, what would be the branch of other repositories in this build? Difficult to decide...

The current Bamboo design only has plan branches for the first repository and all other repositories will be set to use their default branch for builds. The branches can be manually adjusted for each plan branch.

There is a feature request to help to adjust this automatically:

The triggers should work for all of them, but from your description, I assume that you have plan branches defined like:

| Repository  | Plan branch | Repository Branch |
| Main Repo   | "Default" | master |
| Repo 2 | | master |
| Repo 3 | | master |
| Repository  | Plan branch | Repository Branch |
| Main Repo   | "Develop" | develop |
| Repo 2 | | master |
| Repo 3 | | master |

This is to say that if you commit in Repo 2 or 3, it will only trigger a build if the commit is happening in master (or whatever repository branch configured in the plan branches available).

Does that make any sense?
I'll wait for your comments.

Himanshu Rawat August 22, 2019

Hi @Daniel Santos ,

Thank you for the response and also sharing the feature request ticket.

The branches can be manually adjusted for each plan branch.

It will be tedious work instead I would create individual bamboo builds for respective repositories. Manual doesn't fit in the equation of automatic builds ;)

But like you said and explicated in the mentioned JIRA ticket, trigger behavior is only limited to Plan's main repository

This is to say that if you commit in Repo 2 or 3, it will only trigger a build if the commit is happening in master (or whatever repository branch configured in the plan branches available).

We don't commit on master branches so  below will be our final configuration

Plan --> Branches --> Create plan branch --> When pull request is created

But I understood your point and hope to see this functionality implemented.

I am still confused on the trigger configuration?  There are 4 different repositories and it only works for 1st repository in the list. 

Then is there a reason show other repositories and allowing them to check it?

Capture.PNG

Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 23, 2019

Hi @Himanshu Rawat

The build should be triggered by changes in the second repository (third and so on), assuming the commit happened in the same branch configured for a given plan branch.

Screen Shot 2019-08-23 at 16.06.56.png

In this screenshot, we have the Plan branch called bugfix-bugtest

  • The first repository, RAP has the source branch bugfix-bugtest
  • Second repository, Repository initially has the branch master, but it can have any available branch for that repository.

Commits in Repository (second repo) will only trigger bugfix-bugtest if they happen for the branch configured for that repository in bugfix-bugtest plan branch. 

Does that make it clear why commits on the other repos are not triggering the build? am I missing something?

Himanshu Rawat August 23, 2019

Hi @Daniel Santos 

Yeah. Now I understood it.  Explanation with an example had clear the doubts.

Thanks for it.

Like Daniel Santos likes this
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 26, 2019

That is great! 
Let's crush it =]

Like Himanshu Rawat likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events