Reference explicit version of a package in "Script File in Package"

My octopus project deploys an app but I don’t create an Octopus package for that app. My TeamCity build server only triggers release using the “OctopusDeploy: Create release” built in Octopus step.
In my Octopus project -> Process -> Step: I have the “Script File in Package” filled with package published by different project - the deployment project. From that package I reference powershell file which is used by Octopus to deploy my project. Everything works fine except that I don’t know how to explicitly state the package version. Right now, it looks like Octopus is always using the latest version, but I would like to lock the version to be a specific one. As in example below I would like to be able to put e.g. my-other-project:1.2.3 but it looks like it doesn’t allow me to do it. Deployments complain that such package is missing. I also tried “dot” connector - so: “my-other-project.1.2.3” - this doesn’t work neither.

How can I achieve explicit versioning of referenced package? We’re using the 2020.5.0 Octopus version. Thank you

Hi @lukasz.podolak,

First of all welcome to the Octopus Forums and thanks for reaching out.

When creating the release in TeamCity, you should be able to choose the package version for that package with an additional argument. The arguments for create-release are in this documentation: https://octopus.com/docs/octopus-rest-api/octopus-cli/create-release

Please let me know if that works for you or if we need to dig in a bit more.

Thanks,
Jeremy

Hi @jeremy.miller, thanks for a reply.
Well, the thing is that I want to access a different package under specific version, not the one being triggered by TeamCity. Please take a look at the screenshot and description I posted in my original post

Hi @lukasz.podolak,

The only way to state the desired package version is during release creation.

The package version options in the create-release command that Jeremy linked to don’t have to reference the package generated by TeamCity.
When this command is run it queries the Octopus API and searches through the package repository for the listed package name and version that you specify in the command.

Regards,
Paul

1 Like

@paul.calvert thanks for explanation, this works indeed.
Added the following to my Octopus step additional arguments: --package=myOtherPackage:1.2.3 and it worked like a charm!
Many thanks to you both

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.