My project deploys a release with multiple packages. For a specific package, for example package X, near the end of the deployment in a PowerShell script step, I need to get the package version of X deployed in the prior step (same deployment). Our TeamCity build server publishes the build information for package X. I attempted to get the version of X deployed using:
$xVer = $OctopusParameters["Octopus.Release.Package[X].Version"]
However, this did not return anything.
Please advise as to how I can retrieve the version of package X deployed in a prior step.
Thanks for getting in touch! The package version that’s used during execution of a step is stored as an output variable that you can retrieve in subsequent PS script steps with
$OctopusParameters["Octopus.Action[StepName].Package.PackageVersion"]. You can refer to the following doc page for a full list of these variables.
I hope this helps! Let me know how you go or if you have any other questions.
So far so good. But, the project that deploys pakage X is a child project called vis ‘DEPLOY A RELEASE’ step which calls it. I’m able to get the Package X version using [“Octopus.Action[StepName].Package.PackageVersion”] in the child project. But, how do I make that available to the project steps in the parent project?
Never mind. I got it. The same var works in the parent project, Nice!!
Sounds good! Thanks for the update, and please don’t hesitate to reach out if you have any questions or concerns in the future.
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.