Using the version template

Hi, I’m new to how versioning works with Octopus. I’m trying to add a fourth digit to the version template and have the last digit increment automatically. So far I have:

#{Octopus.Version.LastMajor}.#{Octopus.Version.LastMinor}.#{Octopus.Version.LastPatch.#{Octopus.Version.NextBuild}

but it doesn’t increment for me. I’m guessing that the ‘Last’ variables will stay the same as the previous release and the ‘Next’ variables will increment from the last release. Is this correct?

Hi Bryan,

Thanks for reaching out! We support the following digits when it comes to versioning

Major|Minor|Patch|Build|Revision|Suffix

Build and Patch are synonyms , so as a fourth digit you’ll have to use Revision. Your version pattern should look like this:

#{Octopus.Version.LastMajor}.#{Octopus.Version.LastMinor}.#{Octopus.Version.LastPatch}.#{Octopus.Version.NextRevision}

Revision will start from 0 as you’ve never used it before, and it’ll automatically increment by 1 with each release.

Hope that helps!

Dalmiro

I tried Revision and it worked perfectly. Thanks for your help, Dalmiro!