How to get the deployment folder, machine names and version in Octopus

I want to get the deployment folder full path, machine names (if multiple machine), version for a given Octopus project and given environment.

So for example, environment is production.

Actually I want to compare few files of the latest deployment of a project in production environment with the previous deployment.

I am using Octopus client library in C#

Hi Vivek,
Thanks for reaching out with your query.

We have a comprehensive list of the System variables that get set for all parts of our application here:

Its easier to search page directly rather than link each variable to be honest.

If it helps, we have a public API script section for many good examples you can use, using our Octopus client:

Let us know if you have a specific item you need any further help on.

Kind regards,

@paraic.oceallaigh thank you for responding. We have around 150 projects in deployed through Octopus.

So I would like to create some kind of tool which could help developers rather than doing so much of manual work.

That’s why I’m looking for Octopus client library.

I want few info.

User will provide the project name and environment name, my tool should give him the deployment path of last two versions.

So for example project ABC and environment is Production.

So tool should be able to get the below information using Octopus client library.

For example the Latest versions are and And project is deployed on a machine name let’s say SUSIALLPQR1 on path D:Octopus:SomeFolder.

Hi Vivek,
The tool you mention likely falls outside of the support we can offer for your needs.

We do have a Solutions team who could help with some Professional Services and provide guidance for the tool you need.

Is this something you would like to pursue? I can ask them to get in touch and discuss.

Kind regards,

@paraic.oceallaigh I am looking for someone who could help me to get this information using the Octopus Client library in C#. Could you please ask someone from the Octopus Client library team to assist?

Hi Vivek,

I have asked someone from our Solutions team to connect with you and see if they can help you out.

They should be with you shortly.

Kind regards,

@paraic.oceallaigh Thank yo for the quick response.


1 Like

Hi @vivek.nuna

Thanks for your question!

I wanted to let you know that earlier this year Octopus changed its policies around providing API scripts for customers. In the past, we’d get a request such as this, maybe ask a few clarification questions, write up an example script for you to modify, and send it over. Then a few days would go by as you attempted to modify it to fit your needs, but you’d find an error or some additional use case that wasn’t mentioned in earlier conversations, slowing down progress. It wasn’t a great experience for anyone.

Our new policy gives you two choices:

  • We point you in a general direction and provide some pseudo-code and endpoints to consider, but you’d write the script.
  • We now offer professional services where for a fee we’d write API script(s) for you. We’d meet with you, discuss your use case, conditions of satisfaction, any gotchas specific for your instance, and write something specifically for you.

If you opt for general direction, then I’d recommend taking a look at our OctopusDeploy-Api repository, as it contains many examples of API scripts, in different languages. A particular script that might interest you is this one - OctopusDeploy-Api/PackagesDeployedToEnvironmentFromVariables.cs at master · OctopusDeploy/OctopusDeploy-Api · GitHub which looks for information about packages that have been deployed using the variables associated with the deployment of a release. One other thing to note is that it’s unfortunately not possible to retrieve files (that have been deployed through Octopus) via the Octopus Client to preview them.

Alternatively, if you’d like to discuss professional services, I’d be happy to schedule a discovery call.

I hope that helps!


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