Determining Tentacle Agent's version or path from deployment scripts

If my portal and tentacles are on beta 0.9.620.4 (with a tentacle or two on 0.9.620.3):

Is it possible for deployment scripts to determine the Tentacle.exe.config’s install directory?

Some of my scripts would like to operate on the extracted files in the install directory, as defined in the Tentacle.exe.config. We have a case where we define a $OctopusPackageDirectoryPath (and so $pwd from the deployment scripts won’t give us the install directory defined in the Tentacle.exe.config).

Is it possible for deployment scripts executed on a tentacle to query the install directory as defined in the Tentacle.exe.config? Or perhaps the Tentacle Agent’s version (eg 0.9.620.3) or its path (eg C:\Octopus\Tentacle\Agent\Tentacle.exe)?

Thanks for reading.

Lisa

Hi Lisa,

There’s no supported way of doing this that I know of. You may be able to infer it from some PowerShell application state - e.g., maybe ask PowerShell what the current process is - but I don’t know how to off the top of my head.

Could you perhaps define a variable - like DataDirectory - and set it per environment/machine in the Octopus UI, and then read it from your PowerShell script to copy it to the right place?

Paul

Hi Paul,

Thanks for the suggestion, and for responding so quickly.

Although your idea sounds cleaner, for my very basic use case we’ll probably just hard-code the set of values we’ve ever assigned for the install dir, and have the tentacle loop through that until it finds a path that exists.

Thanks again.
Lisa