I have setup octopus deployment pipeine for a active development project. Whenever there is a change build runs and it creates a nuget package in Teamcity. I added the nuget version parameter as 1.0.0-rc000%build.number%, problem is it is picking correct latest version whenever it creates a release automatically till build.number 9. After that It still treats build number 10,11,12 etc has less than 9 and it still picks nuget package with rc version 9 whenever it creates a octopus release. What is the current way to handle this situation, I have to deploy code to development environment whenever there is a change. How should I version the nuget packages ? Please guide me on how to fix this.
When you create a release for your project, there’s a link to choose a specific package version, which shows a dialog. Could you attach a screenshot of that dialog showing the incorrect sorting, so we have some examples to work from? The semver ‘tag’ component is sorted alphabetically, but I suspect your version numbers come out as:
1.0.0-rc0009
1.0.0-rc00010
1.0.0-rc00011
Since it is sorted alphabetically, the behaviour you are seeing is expected. You could fix it by changing the numbers to:
You’ll just need to change the template in TeamCity so that instead of rc000%build.number%, it’s rc00%build.number%. When you reach package 100, drop another zero. Or, set the build.number to a very high value, like 10000, to start with.
There are some other examples here, but this is really a TeamCity issue - as far as Octopus/NuGet is concerned, we are sorting the packages correctly.