Disable artifact publishing if build fails in TeamCity
My build scenario is like this (simplified):
- Compile
- Package (*.zip)
- Deploy to test environment
- 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开发者_如何学Go any check box or something (TeamCity 6.5 Enterprise).
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:
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.
Only copying files to the artifact paths configured in TeamCity after the tests are complete and successful.
精彩评论