Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make TeamCity build fail if artifacts are not found?

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?

like image 359
Paulius Liekis Avatar asked Oct 31 '25 11:10

Paulius Liekis


2 Answers

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.

enter image description here

like image 115
user2192567 Avatar answered Nov 03 '25 20:11

user2192567


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" />
like image 32
vicsz Avatar answered Nov 03 '25 20:11

vicsz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!