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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,556,048
Community Members
 
Community Events
184
Community Groups

Is there a way to trigger a Bamboo build on changes to a specific sub-directory of a git repository?

Our project is a sub-project/sub-directory in a much larger git repository. At this time, moving our sub-project to its own repo is unfortunately not an option.

We would like to trigger our builds based on changes to our sub-project, only, not on any change to the entire repository. Is this possible? Has anyone else run into this situation and solved it?

Thank you very much for any help you can offer.

Julie Pickhardt

4 answers

1 accepted

4 votes
Answer accepted
Jason Monsorno
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Feb 02, 2014

Configure the plan, goto the Repositories tab and select your repository.

Scroll down to the bottom and expand Advanced Options.

There is a dropdown for "Include / exclude files", select "Include only changes that matches to the following pattern" then a textbox will appear underneath it where you can specify a regular expression to express your subdirectory. Example that works for me:

sub/directory/*

I actually had to enter the regex like this:

sub\/directory\/.*

But that worked perfectly. Thank you so much for your help!

I have a Vision subdirectory under the git root and set the include to .*/Vision/.*, but the build is never triggered. Where is the pattern executed? Can I see the output somewhere?

I have tried this with a linked repository and a straight stash repository and neither has worked.  I have tried adding the sub directory as <foldername>\/* and <foldername>/* and that has not worked either. Is there something that I am missing here?

I have also tried and actual fully qualified regular expression as per the Bamboo documentation and it does not pick up the check in.  Is there a way to see the output?  I have a build that is just a straight trigger on the entire repository and it works every time without fail.

I agree with Christopher's comment.  I have tried all combinations in v7.2.2 similar to what he described and nothing seems to work.  What am I missing?

Any help?

This only works for plan-level repositories if you want to restrict the builds of a plan. It's worth mentioning that plan-level repositories are deprecated, so we don't know how much longer they will work in future versions of bamboo ...

It is 2022 now. Is this nasty workaround still the solution for the OP's question? 

0 votes
Config Manager
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Feb 05, 2014

I was pondering exactly the same problem and so this is great :-) When I tried it I didn't have to escape the forward clashes - i.e sub/directory/.* worked fine.

A follow on question that someone may be able to answer...

I tried to define the include pattern with a variable like this :

${bamboo.appname}/.*

but first it wouldn't accept this as a valid regexp, and when I escaped the $ { and } it seemed to take it literally, i.e. it didn't substitute the variable. Anyone know if a variable can be used, and how?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events