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,360,934
Community Members
 
Community Events
168
Community Groups

Trigger branch-plan only on changes in specific repository sub-folder

Edited

I have the following problem and can't find any solution for it:

Our repository contains multiple C# Solutions and we are using pull-requests to bring new code into develop/master.

The target I want to achieve is the following:

  • Multiple builds, one for each solution inside the repository
  • A build is only triggered, if where are changes inside the solution sub-folder
  • When someone pushes a feature-branch and creates a pull-request, all build for all Solutions with changes are triggered and executing the UnitTests for these solutions

I configured my default-plan as follow:

  • The repository is set to our repository on the Bitbucket-Server, default branch is develop
  • In the repository settings I added "Change detection options" and add a RegEx to the Subfolder of Solution 1
  • Trigger of the default-plan is set to "Bitbucket Server repository triggered", using the repository settings described above
  • The branches options are configured to create a new plan "When new branch in repository is created"
  • The triggers of the branch-plan is set to "Same as defined in parent plan"

I expect the following:

  • A developer wants to bring a new feature containing changes for Solution 1 into develop and creates a pull-request
  • The feature-branch is pushed to server and a pull-request will be created
  • As there are changes in Solution 1, the build for Solution 1 is triggered, the build for Solution 2 NOT
  • After the build and all tests of Solution 1 are passed, the pull-request can be merged

Unfortunately it doesn't work as I expect, because on branch-plan creation (at the moment the feature-branch is pushed to the repository), the branch-plan build is triggered, doesn't care if where are changes in Solution 1 or not.

When the developer pushes new changes in the existing branch, it works as I defined and expected (so only changes in Solution 1 triggers the build), but this first build on branch-plan creation is a problem I can't solve... is where some solution how I can handle this?

0 answers

Suggest an answer

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

Bamboo 9.0 is now available

Hey there, Data Center community! I'm Martyna Wojtas and I am the Product Manager for Bamboo Data Center. I’m excited to share that Bamboo 9.0 is now available. We purpose-built this platform to help...

310 views 0 7
Read article

Atlassian Community Events