Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable artifact publishing if build fails in TeamCity

My build scenario is like this (simplified):

  1. Compile
  2. Package (*.zip)
  3. Deploy to test environment
  4. Run tests over the environment

If tests fail TeamCity still publishes artifacts. This is unnecessary and consumes disk space. How can i prevent this? Can't find any check box or something (TeamCity 6.5 Enterprise).

like image 886
UserControl Avatar asked Jul 04 '11 09:07

UserControl


1 Answers

As far as I can tell, TeamCity doesn't have a built-in option to disable artifact publishing if the build fails.

However, in the build script called by TeamCity you could try:

  1. Removing artifact paths from the build configuration, and instead emitting the appropriate TeamCity service messages with your artifact paths only when tests are complete and successful.

  2. Only copying files to the artifact paths configured in TeamCity after the tests are complete and successful.

like image 114
Bilal Avatar answered Sep 24 '22 08:09

Bilal