Reputation: 1730
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?
Upvotes: 4
Views: 2269
Reputation: 490
Similar to other answer here. You can add regex expression that will discover this in the build log and will fail the test:
^Artifacts path '.*' not found$
It is also recommended to add meaningful error message, such as:
Failed to find artifact to publish
Upvotes: 0
Reputation: 61
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:
Artifacts path file.txt not found
This works, I use it in my builds to catch missing artifacts.
Upvotes: 6
Reputation: 9744
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" />
Upvotes: 3