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

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 ? 

0 vote

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

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,493 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you