Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bamboo trigger - Multiple Repository

If I have multiple repositories (say of type Stash) added to a Bamboo Build plan and a repository polling trigger defined with more than one repository selected, is there a way to find in bamboo which repository commit triggered the build ?  

1 answer

0 votes

Hi Saugat,

 

Yes, you can do that. Use the below query to get the desired result.

 

SELECT 
BUILD_KEY,
BUILD_NUMBER,
BUILD_STATE,
BUILD_DATE,
COMMIT_FILE_NAME,
COMMIT_FILE_REIVISION,
NAME AS 'Repository Name',
COMMIT_COMMENT_CLOB AS COMMIT_COMMENT,
AUTHOR_EMAIL,
AUTHOR_NAME
FROM
buildresultsummary a,
repository_changeset b,
commit_files c,
repository_changeset d,
vcs_location e,
user_commit f,
author g
WHERE
a.BUILDRESULTSUMMARY_ID = b.BUILDRESULTSUMMARY_ID
AND e.vcs_location_id = d.vcs_location_id
AND f.COMMIT_REVISION = d.CHANGESET_ID
AND f.REPOSITORY_CHANGESET_ID = d.REPOSITORY_CHANGESET_ID
AND f.REPOSITORY_CHANGESET_ID = b.REPOSITORY_CHANGESET_ID
AND g.author_id = f.author_id
AND c.commit_id = f.commit_id;


Please note: The above query is built for MYSQL and you may have to change the syntax if any other database.

Please accept the answer if you find it's useful so that others can also take benefit from it.

 

Thanks,

Robhit

thanks...good info

But I need the repo name available during the execution of the plan (like through bamboo variable or something else) as the plan have some processing on the repo which triggered the build. I don't think querying Bamboo DB is a suitable option here.

 

 

 

   

robhit Atlassian Team Oct 27, 2017

There is a Bamboo generic repository variable "bamboo.planRepository.<position>.name" which could give you the name of the repository but it will always give you the name of the default linked repository to the plan.

https://confluence.atlassian.com/bamboo/bamboo-variables-289277087.html

Moreover, looking at your first question - "is there a way to find in bamboo which repository commit triggered the build ?"
Let's say you have 2 repo's "RepoA" and RepoB" and you commit changes to "RepoB" then, in this case, the complete build plan will be triggered because we have a repository polling trigger.

But, if the source code checkout task in the plan configuration is configured to use the "RepoA" then this question is not valid in this case because you commit changes to the "RepoB" and the "RepoA" is being checked out or else if you have multiple tasks to checkout multiple repositories then they all will be triggered by bamboo for checkout because the entire build plan is triggered.

Suggest an answer

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

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

191 views 4 6
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