Disable artifact publishing when build fails in TeamCity

My build scenario is similar to this (simplified):

  • Compile
  • Package (* .zip)
  • Test deployment
  • Running tests on the environment

If the tests fail, TeamCity still publishes artifacts. This is unnecessary and consumes disk space. How can I prevent this? Cannot find any checkbox or something (TeamCity 6.5 Enterprise).

+6
source share
1 answer

As far as I can tell, TeamCity does not have a built-in option to disable publication of an artifact if the assembly fails.

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

  • Removing artifact paths from the assembly configuration, and instead transferring the corresponding TeamCity service messages with your artifact paths only after the tests have been completed and successfully.

  • Only copying files in the path of artifacts configured in TeamCity after the tests are completed and successful.

+7
source

Source: https://habr.com/ru/post/891946/


All Articles