LA.27
LA.27

Reputation: 2238

Preventing TeamCity from publishing artifacts on failed build

Here's my project's TeamCity configuration:

Even if my build fails while running the last step, the NuGet package is published as an artifact.

I guess this is not the case - the build failed, so anything it provides shouldn't be considered as reliable.

I've found a similar question asked ~5 years ago: How do I set TeamCity to not produce build artifacts when the build fails?

which says there was no built-in mechanism in TC to support that. Has anything changed during this time ? Can't find anything on the net.

I use TeamCity 9.0.

Upvotes: 0

Views: 948

Answers (1)

Adam Funderburg
Adam Funderburg

Reputation: 406

My only solution to this would be to separate out the deployment of the package to NuGet as a separate build configuration. That way, you can setup your dependencies/triggers within TeamCity so that it never deploys if the build step you have in place fails.

The artifact will still be created on the TeamCity side, since, as you stated, I cannot find a way to prevent that if the build fails. However, your actual NuGet deployment will never execute if setup this way because the dependency will prevent it with the build failure.

Upvotes: 1

Related Questions