0

I want to cancel then start my build through url:

This how I starting my build:

http://<user name>:<user password>@<server address>/httpAuth/action.html?add2Queue=<build type Id>

but when I'm trying to cancel/stop it:

http://<user name>:<user password>@<server address>/ajax.html?comment=<cancel_comment>&submit=Stop&buildId=<internal_build_id>&kill

I'm getting exception:

Error message: Given kill operation code is null
TeamCity: 8.0.5 (build 27692)
Operating system: Windows Server 2008 R2 (6.1, x86)
Java: 1.7.0_21-b11 (Oracle Corporation)
Servlet container: Apache Tomcat/7.0.37

Trace: java.lang.IllegalArgumentException: Given kill operation code is null

Source: Accessing server by HTTP

I tried through REST API but didn't helped me.

4

1 回答 1

1

我在 TeamCity 中分析 js 代码并找到 2 个解决方案

  • 按进程 id 杀死构建:

yourTeamCityUrl/ajax.html?comment=%somment%&kill=%buildQueueId%&operationKind=2&_readd=&submit=Stop

  • 通过构建 id 杀死构建:

yourTeamCityUrl/ajax.html?comment=%comment%&submit=Stop&buildId=%active_build%&kill&operationKind=1

只需要加上&operationKind=1

于 2014-01-22T14:16:15.843 回答