Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Trigger bamboo when pull request is submitted.

jooke April 15, 2019

Hi,

 

I would like to run build in bamboo(on master branch) when some branch was merged into master branch. I need it for uploading new artifacts into Nexus. I know that exists webhooks for these trigger but this is little bit dificult. We have Jira, Bitbucket and Bamboo and everything is linked. Exists better way for this trigger (after merge to master)? 

 

Thank you for help

 

Radek

2 answers

1 accepted

0 votes
Answer accepted
Jimmy Seddon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2019

Hi Radek,

If I understand correctly you want a build to run only for the master branch when a pull request has been merged.

Do you allow changes to be made to the master branch if they don't come from a pull request?

I ask because you could make a clone of your current build plan that only watches for changes to the master branch and then builds and saves the artifacts whenever the master branch alone is updated.

-James

jooke April 15, 2019

Do you allow changes to be made to the master branch if they don't come from a pull request?

 

No, we don't allow changes without pull request. How to set this watching for master branch? I can't see there this option.

 

Radek

Jimmy Seddon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2019

Hi Radek,

You would define this in the linked repository.

LinkedRepository.JPG

Like itnasyrov likes this
jooke April 15, 2019

Yes, I have it but how to run this plan after merge?

 

bamboo-repo.png

My triggers are empty and there is no option for triggering after merge.

Jimmy Seddon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2019

Hi Radek,

On the build plan itself you will want to make sure you have a repository trigger setup there that uses your linked repository that should do what you want it to do.

BuildPlanTrigger.JPG

jooke April 15, 2019

So, when is something new in master then this trigger is run? What do you have in tab Branches? I'm little bit confused with "Create plan branch". 

Jimmy Seddon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2019

I don't have anything listed for branches in this plan.  By default the plan will run for the branch you have listed in the linked repository, there is no need to add a plan branch if master is all you plan to build with this.

jooke April 16, 2019

I have following setting in branch. I don't know how to delete it.

 

branch.png

Jimmy Seddon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 16, 2019

Hi Radek,

You don't need to delete that, those are the default setting which won't automatically create plan branches (hence the create plan branches 'manually').

You should be able to just merge a pull request into the master beanch and watch the new plan automatically pick up the new change and start building.

-James

Like itnasyrov likes this
jooke April 16, 2019

Many thanks!

0 votes
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2021

You could use an automation rule in Jira for this use case!

Steps:

  1. add the Commit Created trigger
  2. add a condition which continues the rule only if the {{devops.commit.isMerge}} smart value is true
  3. start the Bamboo build

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events