6

There is a known problem that if you deploy during a TeamCity build, a previous version will be deployed (as the current will be available only after the build is finished).

Documentation suggests creating a secondary TeamCity BuildConfiguration as a workaround but it sucks and seems not to work anymore (there is a number of bug reports about it).

There was an alternative solution suggested in the comments to this question. The idea is to push your current build nuget package to the Octopus nuget server (and deploy based on it instead of TeamCity nuget feed).

So I've created a NuGet Publish build step, specified Api Key and Package Source but I have no idea what to specify in Packages field. In other words, what is the path to a freshly created nuget package for my build?

Community
  • 1
  • 1
SiberianGuy
  • 22,118
  • 44
  • 135
  • 253

2 Answers2

6

OctoPack creates the .nupkg file in a subdirectory \obj\octopacked\ of the project that contains the .nuspec file

enter image description here

Evolve Software Ltd
  • 3,525
  • 1
  • 14
  • 18
  • Thanks! I should have looked TeamCity build log through more thoroughly. Done it, works like magic. My deploy finally contains current build, not a previous one. – SiberianGuy May 05 '15 at 19:06
  • You can use wildcards to pick up multiple packages: `**\obj\octopacked\*.nupkg` – Rebecca Scott Apr 05 '16 at 07:05
2

It's described here. Specify a newline-separated list of NuGet package files (.nupkg) to publish to the NuGet feed. List packages individually or use wildcards.

The path to the newly created package file will depend on how your build is setup. But you can try a wildcard like **/*.nupkg and it will find all nupkg files in your build folder structure.

ryan.rousseau
  • 1,385
  • 1
  • 9
  • 20
  • I believe your answer is great TeamCity-wise but the question was specifically about where Octopus puts his nuget-packages produced by OctoPack – SiberianGuy May 04 '15 at 16:31
  • I don't quite follow. If you're pushing the nuget package created by the team city build, **/*.nupkg should pick up any nupkg files generated by your build. Octopack also has options to publish the package after building it, which might be useful in your case. – ryan.rousseau May 04 '15 at 20:26