how do I get git revision number in my bamboo release version tag

Ronnie Otts October 10, 2013
I have a deployment project set up in bamboo, my relase tag has the bamboo build number on it, but I want to add my git revision number
how do I get git revision number in my bamboo release version tag

I tried the following
1.2-${bamboo.buildResultKey}-${planRepository.revision}

comes out as

1.2-PROJ1234-${planRepository.revision}

3 answers

1 accepted

1 vote
Answer accepted
Marcin Gardias
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 10, 2013

please try: 1.2-${bamboo.buildResultKey}-${bamboo.planRepository.revision}

0 votes
IC24 February 24, 2017

I am using ${bamboo.CpmsVersion}.${bamboo.buildNumber}.${bamboo.planRepository.revision} to build my version but the revision comes out as a GUID

1.0.6.dc52de7df96caae56236cc79f9b840e1948dbdb3

I am using the version in a C# project and it is not happy with this version. How do i get the revision number as an integer from git (I am using BitBucket), is this even possible?

guidovezzoni December 14, 2017

I am having the same issue - apparently every time I run a regular build rather than a customised one - I would expect planRepository.revision to be null in this case but it isn't.

Marcin Gardias
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 18, 2017

AFAIK There's no such thing as version _number_ in git. The hash is the revision.

0 votes
Ronnie Otts October 10, 2013

That did it, thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events