Cannot find installation folder (for pre-deploy script to act on)

Having searched extensively, and tried a number of Octopus Parameters, I’m still unclear where my .nupkg deployment package is being unpacked on each tentacle. I’d like to modify one file (robots.txt) for some environments, but I’m not sure where to reliably find it.

In the Pre-Deploy phase, from the following script is run to try to find out where things are at:

Write-Host "Output.Package.InstallationDirectoryPath " $OctopusParameters[‘Octopus.Action[DeploySV].Output.Package.InstallationDirectoryPath’]
Write-Host "Octopus.Tentacle.CurrentDeployment.PackageFilePath " $OctopusParameters[‘Octopus.Tentacle.CurrentDeployment.PackageFilePath’]
Write-Host "Octopus.Action.Name " $OctopusParameters[‘Octopus.Action.Name’]
Write-Host "Octopus.Action.Package.CustomInstallationDirectory " $OctopusParameters[‘Octopus.Action.Package.CustomInstallationDirectory’]
Write-Host "Octopus.Step.Name " $OctopusParameters[‘Octopus.Step.Name’]
Write-Host "Octopus.Step.Number " $OctopusParameters[‘Octopus.Step.Number’]
Write-Host "#{Octopus.Action[website package].Output.Package.InstallationDirectoryPath} " $OctopusParameters[’#{Octopus.Action[DeploySV].Output.Package.InstallationDirectoryPath}’]

Output.Package.InstallationDirectoryPath
Octopus.Tentacle.CurrentDeployment.PackageFilePath D:\Apps.Tentacle\Packages\SV.2015.3.256-RC_E3B72B817C12FF4D90DEB935FAB77906.nupkg
Octopus.Action.Name DeploySV
Octopus.Action.Package.CustomInstallationDirectory
Octopus.Step.Name DeploySV
Octopus.Step.Number

Do I need to specify a Custom Installation Directory? If so, what are the other implications of doing this?

david

Hi David,

Thanks for reaching out. Most of the variables you listed above are only available AFTER the deployment step has finished. In your case you need to use $OctopusParameters['OctopusOriginalPackageDirectoryPath']. This variable is only available for a short period of time, for Octopus itself, in the package step, on the machine. But its just what you need for your Pre-Deploy script.

Hope that helps!

Dalmiro

Thanks, Dalmiro. That was precisely the one I needed.

david