Pushing NuGet to Octopus from VSTS

Hello All

I am having issues packaging up a project to push through to Octopus.

I followed the instructions located here: http://docs.octopusdeploy.com/display/OD/Use+the+Team+Foundation+Build+Custom+Task but when I do that it fails at the first step (probably based on me doing something wrong in VSTS).

So i made a couple of changes to simplify the directories and now my Package Application and Publish Build Artifacts steps work but it fails on Push package to Octopus.
The error is: 016-09-16T20:22:41.7524105Z ##[error]Cannot find path ‘C:\a_tasks\OctopusPush_d05ad9a2-5d9e-4a1c-a887-14034334d6f2\1.2.81$(Agent.ReleaseDirectory)\DevTestpkg\DevTestNuGet.0.1.20.nupkg’ because it does not exist.

Attached are the log files. Any pointers greatly appreciated.

3_Package_DevTestNuGet.txt (1 KB)

4_Publish_Artifact_DevTestpkg.txt (617 Bytes)

5_Push_Packages_to_Octopus.txt (369 Bytes)

2_Get_Sources.txt (3 KB)

6_Post_Job_Cleanup.txt (233 Bytes)

Added screen shots of the Build stage

Hi,
Looking at some of the VSTS documentation on available variables, it appears as though the $(Agent.ReleaseDirectory) is not actually available during a build process. My guess is that its only populated if you are using Release Management. The error you are seeing indicates that VSTS is unable to replace the variable with its correct value before passing it to the Octopus Deploy push step. My understanding, as outlined by the documentation, is that the publish artefact step isn’t really needed unless:

… your Package Application step is part of your Build process and your Push Packages to Octopus step is part of your Release process, then you will need to add a Utility → Publish Artifact step to make the package available to the Release process.

Given you are going straight from pack to push you should be able to bypass the publish step (unless you want it to actually get pushed to the VSTS server for some later step). The $(Agent.ReleaseDirectory) variable is meant for use only if you have your push step configured as part of a release process managed by Release Manager.If you are having problems locating the deployed package, perhaps it may help if you temporarily replace the push step with a Powershell step that simply echos out file path (and if a file exists at that location). Once you have these details correct, then you can swap it back with the Octopus Push step.

I hope those details made sense. Let me know if you need further clarification or encounter more problems.
Cheers,
Rob

Thanks Rob, you helped me solve this issue :slight_smile: