Octopus deploies a version not from command line option

Hello.
I’m expecting if I set up package version number in “OctopusDeploy: Create release” step in TeamCity, Octopus must deploy exactly this version, not last one from it’s package library.
Is it a bug or am I not right?

And why Octopus selected 0.0.9 version as a last version:
“Found matching version 0.0.9: C:\Octopus\Packages\MicroservicesExternalApi\MicroservicesExternalApi.0.0.9.zip”
if last version on this Tentacle was 0.0.13 ?

ServerTasks-16938.log.txt (28 KB)

teamcity.log (3 KB)

Hi,

Thanks for reaching out!

I’m expecting if I set up package version number in “OctopusDeploy: Create release” step in TeamCity, Octopus must deploy exactly this version, not last one from it’s package library.

What you put on the Release Number field of the OctopusDeploy: Create release step is going to be used for the release version, but not necessarily for the package version. By default the latest version of the package will be used. In this case 0.1.6-noauth is higher than 0.0.14, so it makes sense that that package is being picked.

All that step does is wrap an Octo.exe command that gets executed during the build. The Release Numer field value for example gets passed to the --version parameter of Octo.exe.

To specify the package version you want to use, you can use the --DefaultPackageVersion parameter on the Additional Command Line Arguments field on your step, and pass it a TeamCity variable that holds the package version number you want to use (ideally that’ll be the same as the build number)

More info about all the available parameters to use here: https://octopus.com/docs/api-and-integration/octo.exe-command-line/creating-releases

Hope that helps!
Dalmiro

Hello Dalmiro,

and thanks you!

Now it’s working as I expecting!

Best Regards,
Vitaliy.

Glad to hear that :slight_smile: