Adjust BITRISE_BUILD_NUMBER


#1

Hi,
In some of my workflow I needed to adjust the BITRISE_BUILD_NUMBER (increase). Because I use the buildnumber if my version of my package - but it’s a bit offset the correct number, I use following script step:

let "BITRISE_BUILD_NUMBER=BITRISE_BUILD_NUMBER+4"
envman add --key BITRISE_BUILD_NUMBER --value "${BITRISE_BUILD_NUMBER}"

I just want to know if this the correct way to do it? Or maybe there is another way to do this.
If this is correct, would it be OK that I create a Custom Step to adjust this variable (with increase, decrease option)?


#2

Sure, that should work, although if you do that your build number will not match the one on the bitrise.io UI.

You can find the related feature request at Set bitrise build number and the discussion includes a script too, but yours should work as well.