0

I just migrated some builds from bamboo over to azure devops and I need to get the build numbers in ado to start from a specific number, for example last build in bamboo was 50, I need the first build in ado to be 51. How can I accomplish this via yaml pipeline?

Can I do someting like name: $(last.bamboo.build)+$(Rev:r)?

Thanks all in advance.

Redline1111
  • 131
  • 2
  • 11

1 Answers1

1

If you want to have simple number versioning and continue it from certain number you can do it like this:

name: $(Rev:r)

steps:
- script: echo '$(Build.BuildNumber)'
- pwsh: |
    $buildId = 50 + $(Build.BuildNumber)
    Write-Host "##vso[build.updatebuildnumber]$buildId"
- script: echo '$(Build.BuildNumber)'

Krzysztof Madej
  • 32,704
  • 10
  • 78
  • 107