Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to update (increment) a plan-level (or higher) variable?

Pascal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 4, 2015

I'm using Bamboo plan branches. These are deployed through Octopus Deploy. The latter expects a unique release number with every deploy. Bamboo offers auto incrementing for releases of regular branches but not for plan branches. This is a true pain. 

The only solution I see is to have a plan-level (or higher will do too) variable that I can increment and update with every deployment. But so far I have tried:

  1. to update a regular Bamboo variable
  2. to write the variable to a globally accessible file with Powershell, but the scope of a script is the current deployment directory
  3. to use system variables, but I wasn't able to write to these from script either

Is any of this possible and if so: how? Or is there a better solution to my core problem?

Thanks, Pascal

 

1 answer

1 accepted

2 votes
Answer accepted
Pascal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 4, 2015

Yes! I got it to work using the Variable Task add-on for Bamboo. Here's how I set it up:

  1. Create a plan-level variable, e.g. 
    Plan_level_variables.png
    Add_plan_variable.png


  2. Add a "Version Variable Incrementer" deployment step with the following configuration:
    Version_Variable_Incrementer.png 
  3. Use the variable ${bamboo.release_sequence_number_for_plan_branches} in subsequent steps, e.g. in the release numbering for Octopus Deploy:

    create-release --project "Test" --releaseNumber ${bamboo.alphaVersion}-alpha-${bamboo.inject.jiraIssueNumber}-${bamboo.buildNumber}-${bamboo.release_sequence_number_for_plan_branches} --packageversion ${bamboo.alphaVersion}-alpha-${bamboo.inject.jiraIssueNumber}-${bamboo.buildNumber} --ignoreexisting --server http://localhost:8090/ --apiKey ${bamboo.OctopusApiKey_Password} --releaseNotes "${bamboo.inject.jiraIssueNumber}"

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events