TeamCity command line build runner: How to make the build fail?

谁说我不能喝 提交于 2019-12-03 09:29:45
Sergey Mirvoda

See Build Script Interaction with TeamCity topic.

You can report messages for build log in the following way:

##teamcity[message text='<message text>' errorDetails='<error details>' status='<status value>']

where:

  • The status attribute may take following values: NORMAL, WARNING, FAILURE, ERROR. The default value is NORMAL.
  • The errorDetails attribute is used only if status is ERROR, in other cases it is ignored.

This message fails the build in case its status is ERROR and "Fail build if an error message is logged by build runner" checkbox is checked on build configuration general settings page. For example:

##teamcity[message text='Exception text' errorDetails='stack trace' status='ERROR']

Update 2013-08-30:

As of TeamCity 7.1 build failures should be reported using the buildProblem service message instead:

##teamcity[buildProblem description='<description>' identity='<identity>']
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!