I am using Octopus in conjunction with TeamCity. I use OctoPack and publish to the Octopus NuGet feed. I’ve just noticed that some of my builds are using the wrong package version when creating a release and are using an older one than what was just created in that TC build.
What determines the ordering of packages in the NuGet feed? I’ve attached an image that shows my current situation. Build 105 is the newest, but 99 is being selected as the “latest”.
Thanks for getting in touch! When using TeamCity, it is recommended that you define the package version to use from the build using the additional commands feature of the plugin steps. It is the most accurate way to make sure the correct package is used. It also means you can build and deploy older versions if required. On our documentation page we show how to define this: https://octopus.com/docs/api-and-integration/teamcity#TeamCity-TriggerDeploymentsTriggeringdeploymentsfromTeamCity
If you see our image example it shows you can define the package version from your build number under ‘additional command line arguments’.
The screenshot you have provided does appear to be out of versioned order, and this was something we corrected in 3.8.8 : https://github.com/OctopusDeploy/Issues/issues/2867
What version are you running?
We do still suggest you define your package explicitly, to allow out of order deployments and releases.
Thanks for getting back to me. We’re using Octopus version 3.11.6 so I’m surprised to still see this issue here.
I’ll consider looking at using TeamCity to explicitly provide the package version, thank you for the documentation reference. Can you recommend how I may easily combine this with the “OctoPackAppendToVersion” option?
Looking at your version, anything in a pre-release will be alphanumerically sorted unless it can be split on fullstops.
If you were to change to a 4 part version system it would order correctly such as 22.214.171.124-ci.
As for using
OctoPackAppendToVersion and defining your package version, this should be okay as it appends the
-ci so you could use their build variable and append the
-ci in that parameter.
Please let me know if I can provide more detail or an example for you.