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,557,528
Community Members
 
Community Events
184
Community Groups

BAMBOO get commits that triggered build

Hi!

Is there a way to get the git log with the commits that triggered the build from the command line inside the build agent?

I'm building an Android app with gradle and push it to Crashlytics alongside with a changelog.txt file. I would like to add those commits to a changelog.txt per build so I would know what that build is about.


Thanks!

PS: Sorry if I'm not offering enough details, it's my first question here laugh

2 answers

1 accepted

6 votes
Answer accepted

If you're submitting things via a script, you can use bamboo variables to get the build's revision and get the commit log and write it to a file.

Here's an example using git:

git log ${bamboo.planRepository.previousRevision}..${bamboo.planRepository.revision} --oneline > ./commits.txt

 

Other bamboo variables: https://confluence.atlassian.com/display/BAMBOO/Bamboo+variables

This seems to do the trick! Thanks!

I tried following but this say "log: command not found"

gitlog=git log ${bamboo.planRepository.previousRevision}..${bamboo.planRepository.revision} 

What am I doing wrong here ? 

The variable $bamboo.planRepository.revision  only revers to the commit hash of the default repository in the plan. not the commit that actually triggered the plan in a multiple repository plan configuration.  in my scenario the actual variable for revision is 

$bamboo_planRepository_9_revision

is there a variable for the repo name or the exact commit that triggered the plan without having to figure out the repository position. ?

Thanks

is there a variable for the repo name that triggered the plan ?

Same question.

0 votes
Jaime S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Aug 05, 2015

Hi, Andrei.

 

I'm not sure if you can get this information from the agent within the instance, but this information is available under the 'Commits' tab in Bamboo itself in the build information, if that's helpful.

Kind regards,
Jaime Kirch da Silveira
Atlassian Cloud Support

this information is available under the 'Commits' tab in Bamboo itself in the build information

Any REST API for that?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events