How to make TeamCity build fail if artifacts are not found?
Question
Is it posible to fail TeamCity builds if artifacts are not found? I mean without writing any special script, i.e. does TeamCity has such built-in functionality?
Solution
No, you're going to have to implement that functionality into your build script.
i.e. if you are using MSBUILD .. after everything is complete run the following command:
<Error Condition="!Exists('someArtifact.txt')" Text="Error!!! Artifact doesn't exist" />
OTHER TIPS
In TeamCity 7.x you can catch this using a build failure condition. You can add a condition in your build configuration to fail on specific text found in a build log.
For example fail on text:
Artifact path file.txt not found
This works, I use it in my builds to catch missing artifacts.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow