如果 TeamCity 中构建失败,则禁用工件发布
我的构建场景如下(简化):
- 编译
- 包 (*.zip)
- 部署到测试环境
- 在环境中运行测试
如果测试失败,TeamCity 仍会发布工件。这是不必要的并且会消耗磁盘空间。我怎样才能防止这种情况?找不到任何复选框或其他内容(TeamCity 6.5 Enterprise)。
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 any check box or something (TeamCity 6.5 Enterprise).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,TeamCity 没有内置选项来在构建失败时禁用工件发布。
但是,在 TeamCity 调用的构建脚本中,您可以尝试:
从构建配置中删除工件路径,并发出相应的 TeamCity 服务消息才包含您的工件路径。
仅在测试完成并成功后将文件复制到 TeamCity 中配置的工件路径。
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.