OctoPack doesn't appear to publish artifacts in TeamCity when it should

Hi all,

It seems like OctoPack in our TeamCity environment might be functioning incorrectly. I’ve spent the better part of the day trying to rule out that we’ve done something wrong. I’m hoping you’ll help me catch what we’re doing.

This involves a WebAPI project.

The problem

We build the app via TeamCity and the build completes, the tests are run, etc. and everything completes successfully.

However, nothing appears in the TeamCity artifacts for the build. According to the Octopus documentation, it’s supposed to take care of publishing the artifact when being run, but no matter what I try I can’t get it to ouput the .nupkg artifact.

Research into the Problem

I’ve confirmed the following:

  • The API project builds correctly
  • The API project has a .nuspec file with the same as the project (e.g. if A.B.C is the project name, A.B.C.nuspec resides in the root of the .csproj
  • The OctoPack extension is installed on the API project.
  • OctoPack extension is installed in TeamCity
  • OctoPack is enabled on the same build step where the build is compiled.
  • I see in the build output log that OctoPack is enabled.
  • The .nuspec file is nothing fancy (a copy of the default from the Octopus wiki, filled out and removing the release notes section).
  • The version number is valid to the best of my knowledge – currently it’s 0.0.0.[counter], e.g. 0.0.0.20.

Question

Are we doing anything obviously wrong here? I’ve used OctoPack on previous WebAPI solutions and I don’t recall there being any other steps to complete for this to work.

Thanks in advance for any help you can provide!

We experienced a similar problem. It would seem that Teamcity can only guarantee that the nuget has been published to the built in nuget server once the entire teamcity project has been completed.

So now each build is broken into 2 teamcity projects:

  • CI Step
  • Publish Step (dependency on CI Step)

If you used something like Artifactory, Proget or an external nuget server this would not be an issue.

Figured it out!

The issue in this case was that I’d misread the log that said Octopus was running – see, I knew it would be my fault. :slight_smile:

The log indicated that the Octo nuget had been installed, not that it was running.

Once I realized that, the culprit became clear: a bad merge at some point had removed the post-build task from the .csproj file. So it was never being called at all.

A quick uninstall/reinstall of the package had the project file set up just fine, and we’re back off and running again.