Is it possible via the API to download the last successfully released nupkg via the api or octo

Is it possible via the API to download the last successfully released nupkg via the api or octo.

I have a deployment that generates COM+ interops and I need these proxies also for building against.

In my automated build i need to somehow automatically download the nupkg that contained the proxies extract and build against them. I looked at Octo.exe but i could not see how it could be done and am hoping the rest api could help me.

Is there something like

curl api/feeds/the-project/latest-successfull-release/test/mypackage/download… etc
curl api/feeds/the-project/latest-successfull-release/live/mypackage/download… etc

to enable me to download the packages ?

thanks in advance

Just to be clear in what i am trying to achieve.

When i run msbuild - the first thing i need to do is query the octopus server and pull down the currently deployed package that contains interop libraries i need to compile against.

so if i am producing a live build i want to grab the live interops packag and compile
against this automatically.

Hi Steve,

Thanks for getting in touch!

Depending on what you mean by “pull down the currently deployed package”, you should be able to do it, however you’d have to do it in a few steps by walking through the API.

The built-in nuget feed is a write-only feed (i.e. you won’t be able to use it as a package source outside Octopus) and it doesn’t contain any information about deployments - it’s simply a nuget repository. Judging by your description, it sounds like this could be a dealbreaker.

However, if all you want is the package versions, they are referenced by the release. This works regardless of the package source, so if you’re using an external feed, you can still find the versions.

It’s not trivial, but here’s a guide as to how you could get the package versions of the latest release:

  • /api/dashboard/dynamic?environments=Environments-1&projects=Projects-1 will give you the latest deployment to the Environments-1 environment for the Projects-1 project (in the Items array).
  • Follow the Items[0].Links.Release link to find the Release details for this deployment
  • The SelectedPackages array contains the versions for packages used in each package step.
  • If you need the actual Nuget package name used in that step, hit /api/projects/Projects-1, then follow the Links.DeploymentProcess link to find the process
  • Parsing the process would involve matching the step name, then finding the Octopus.Action.Package.NuGetPackageId for the Action within it.

A tool like PostMan would be really helpful while you’re putting together something like this.

Hope that helps!

Damo