How to get package version from previous Deployment step?

I am running an IIS deploy step which correctly deploys my application.
I am running another step which should place a file in the same location where the application was just deployed.

I am using the: File System - Create File step template

using #{Octopus.Tentacle.Agent.ApplicationDirectoryPath}/#{Octopus.Environment.Name}/#{Octopus.Project.Name}/#{Octopus.Action[IIS_Deploy].Package.PackageVersion}/filename.ini

This ALMOST works, but the final variable #{Octopus.Action[IIS_Deploy].Package.PackageVersion}
does not resolve and instead just creates a folder with the same name “#{Octopus.Action[IIS_Deploy].Package.PackageVersion}”

The step when the deployment of the package happens is called IIS_Deploy.

Any guidance on how to get this to work?

Hi Kelly,

Thanks for getting in touch! An easier way to get to the installation path of a prior package step would be to use the system output variable Octopus.Action[StepName].Output.Package.InstallationDirectoryPath, which will evaluate to the equivalent to what it looks like you’re building up with what you’re currently using (i.e. something like C:\Octopus\Tentacle\Apps\Environment\Project\Version). Would this variable work in your scenario? You can reference this variable, and others in the following doc page. :slight_smile:

Let me know how you go and if you have any further questions going forward!

Kind regards,

Kenny

Thank you. I’ll give this a try.

Hi Kelly,

You’re very welcome! Let me know how you go and if you have any other questions in the future. :slight_smile:

Kind regards,

Kenny

This worked out perfectly. Thanks again.

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