7

I am doing the following steps:

  • dotnet restore
  • dotnet publish
  • octopusDeploy: Push packages

The second step creates a 'published-app' folder and the third step is meant to take that and create a .zip file and send it to the Octopus server.

The third step is connecting to the Octopus server but gives the error:

Running command: octo.exe push --server http://server.com/ --apikey SECRET

Pushing packages to Octopus server

Please specify a package to push

I am following this https://stackoverflow.com/a/38927027 so my third step has:

%teamcity.build.workingDir%/published-app/**/* => App.zip

Any ideas why the zip file is not being created?

Community
  • 1
  • 1
KevinUK
  • 4,931
  • 4
  • 29
  • 45

1 Answers1

0

Not sure if you ever got this working for yourself, however just in case it helps anyone we recently came across the same issue deploying an AspNetCore 2.0 web application running on net471 being built by TeamCity 2017.1.4 (build 47070).

After some tinkering I noticed that the "OctopusDeploy: Create and Push Packages" build step ran at our git checkout root directory, so I ending up having to use the following values for the "Package path patterns"

%ProjectDirectory%/published-app/**/* => %ProjectName%.%GitVersion.NuGetVersion%.zip

NB: %ProjectDirectory%, %ProjectName% and %GitVersion.NuGetVersion% are build parameters we have manually defined elsewhere in the build process that TeamCity can replace. %ProjectDirectory% is simply the application's source directory relative to the root of the git checkout i.e. WebApplication1 so the full path would be <full checkout path>/WebApplication1

Another gotcha that we experienced was that at the time of writing the combination of TeamCity and octo.exe (from Octopus.TeamCity v4.15.10) didn't like creating nupkg files, so make sure you try to produce a ".zip" file. In the error instances we would receive the following error:

Error from Octo.exe: Cannot run program "C:\BuildAgent\temp\buildTmp\octo-temp\3.0\octo.exe" (in directory "C:\BuildAgent\work\4e62985fa616fa1f"): CreateProcess error=206, The filename or extension is too long

Liam Flanagan
  • 398
  • 3
  • 11