0
votes

I have a TeamCity build configuration where step 2 is packing a NuGet package and step 3 is publishing the NuGet package to an external build server.

At least that was my intention.

When I omit step 3 the build is success and the package is created and placed in the directory I specified in step 2.

When I include step 3 it fails because TeamCity has not yet placed the created NuGet package at the specified destination.

Am I approaching this the wrong way, do I perhaps need another build configuration with publish that depends on the first build configuration ?

1
You know that Teamcity includes a nuget server and you dont need to Publish to it?James Woolfenden
I know. We have two nuget servers for different purposes. TeamCity is one and the other one is where this package is going.Oskar Emil
If its a problem with build steps and timings maybe move step 3 to a different build configuration with a dependency trigger?James Woolfenden
If you use standard NuGet Pack and NuGet Publish build steps, than is looks like an issue. Could you please attach a build log where publishing fails?Nikita Skvortsov

1 Answers

0
votes

It turns out when packing NuGet packages to an external resource like I first did, example \\foo-server\temp\\nuget the NuGet packages would not be copied to the destination until the build was complete, after step 3 should execute.

Solved it by just using 'nuget' as destination directory, creating a temp folder in the checkout directory of the Build Agent. By doing it that way the packages are available inside the build configuration so step 3 can access them.