we’ve deployed an older release from the integrated Octopus Feed (pushed from TeamCity). But it turns out, that it took the the second latest version from the integrated Octopus Feed.
The version which we thought that we deploy is 5.2212.2.29-release. The package which actually was deployed was 5.2302.2.6-release and the latest version at that time was 5.2302.2.8-release
So that are the names which are coming from Octopus Library → Packages.
Package Name is “OurRelease”
In the Overview → Default Channel we have clicked on the deploy button for 5.2212.2.29-release.
Looking at the task log it says:
Package OurRelease v5.2302.2.6-release was found in cache. No need to download from feed.
And the name of deployment is Deploy “XYZ” release 5.2212.2.29-release to “someUrl”
In the Deploy Package Step we have selected the PackageID “OurRelease”
Any ideas why that could happen? We are using Octopus Deploy Server 2022.1.2364
When creating a new release, Octopus will use the latest version unless a package version is specified. In this context, “latest” is defined as the “highest version number”. The only reason I think it would select the version it did instead of 5.2302.2.8 is if that version wasn’t available at that moment. If TeamCity created the release, the log for that step should include some information on why it selected the package it did.
If your releases are being created from a build pipeline, you can add the --packageVersion=VALUEcommand to ensure that the release uses the same package version that was built and uploaded.
If you’re creating releases via the UI then it’d be the packages section that you’d need to check to ensure the correct version is selected and adjust it as needed.
Looking at those screenshots, I am assuming that this release was created when the 5.2212.2.29 package was pushed to the server (Jan 24 5:11).
This would mean that at that moment in time, 5.2302.2.6 was the latest version as the 2.7 and 2.8 versions weren’t added until later.
Do I need to add packackageVersion to Additional command line arguments in team city?
That’s correct, you can drop it straight in there, and the version specified will apply to all steps in the deployment. If you ever need to specify a different package version for different steps there is a different argument for that listed within that doc.