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,554,452
Community Members
 
Community Events
184
Community Groups

Release Versioning on deployment: Best Practices?

Hey there,

I am implementing CI with the help of Bamboo in my company and got some fundamental problem understanding how I would set up a deployment process with Bamboo's deployment-projects.
Right now we are working with GitFlow: So, for each feature/bug we create a branch and later on merge them into an development branch after code reviews were done. 
We are primarly using C# projects where the version number has to be known during compile-time (in AssemblyInfo.cs).
So, right now with each Merge into development a build is triggered which creates some version-number that is fixed in the code. If I want to use a deployment project now and set the release-version there, it won't make any sense because it is already hardcoded in my build-artifact.
Is there any advice or tutorial on how to do this in a proper way? 

Currently we create a release-branch for each planned release. In this release planch we set the planned version number (i.e. 1.2.3). What I want to achieve is that the version number is set during the deployment process.

2 answers

0 votes
thePair
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jan 04, 2019

I know this is an old thread, but I wanted to share my experience on this topic, since I had the same experience. 

(I'm using the version 6.5.0 of Bamboo for my testing.)

What worked for me, while creating the "versionNumber.txt" file was actually to put the name of the variable, but without the "namespace". That means that what actually worked for me was to create a file with the data as...

bamboo.versionNumber=1.2.3

 ... so without the "inject" part.

That, while configuring the Inject Bamboo variables --> Namespace, and setting the Namespace as Inject, will indeed create a variable that you can call as...

${bamboo.inject.bamboo.versionNumber}

 ...in the Release versioning. 

That's just a little tweaking that I've had to do to make it work in my environment. ;-)

Also, apart from the manual effort on creating the file/variables, I've also tested this free plugin:
Maven POM Value Extractor

It works like a charm and is a very good alternative as well!

 

Cheers!

0 votes
Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 04, 2018 • edited

Build plan variable can be used in deployment Release versioning too.

  1. In the build plan that create the version number, create a file (example: versionNumber.txt) to store the version number in the following format: 
    inject.bamboo.versionNumber=1.2.3
  2. Create an Inject Bamboo variables task in the build plan with the following setting
    • Path to properties file: versionNumber.txt
    • Namespace: inject
    • Scope of the variables: Result
  3. In the deployment project, set the following Release versioning:
    ${bamboo.inject.bamboo.versionNumber}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events