I’ve a PS script running several steps after the referenced action. I am attempting to ascertain the path in which the package was deployed (e.g. F:\Octopus\Applications\Localhost\Coach.Web\20180806.4) during an earlier step. I am doing this to change the permissions of a child folder.
This is the code I’m using to evaluate this output variable:
“Deploy Coach Web” is the step I am wanting to know the Package.InstallationDirectoryPath of"
Thanks for getting in touch! Using the single quotes (') on your $path variable means everything within these will be treated as a string literal. Using double quotes instead will allow the variable to be evaluated and changing this should give the expected result. It should look like the following.
I’ve more info on this now. It fails to work when calling from a step in a bundle (deploy a release). However, if I remove the host indexer from the Output array like this:
Thanks for following up and clarifying your scenario and requirements. This does in fact work differently when using the Deploy a Release step. You can pass variables to the child project, but you would need to pass each machine-specific variable separately and call them in the child project as you would a standard project variable (i.e. #{VariableName}). Only a single value is given to a variable being passed, which isn’t machine-scoped.
What I did when playing around with this is create these variables in the Deploy a Release step, where each would have their own unique machine-specific value for the installation directory.
Would this help get you closer to where you need to be? You could theoretically add some logic to only display the relevant value for the specific machine.
I hope this helps! Let me know how you go or if you have any further questions moving forward.