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.
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.
Let me know how you go and if you have any further questions going forward!