通过命令行运行Teamcity构建

时间:2015-10-16 11:33:54

标签: command-line teamcity

我想通过命令行运行在Teamcity中创建的构建作业。是否可以通过命令行运行teamcity构建?如果是,那么命令是什么?

2 个答案:

答案 0 :(得分:9)

如果curl是一个选项,您可以尝试此http请求:

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

Have a look了解更多信息。

答案 1 :(得分:1)

通过命令行触发构建的推荐方法是使用REST API。

curl -u user:password --request POST  http://teamcity:8111/app/rest/buildQueue --header "Content-Type:application/xml" --data-binary @build.xml

build.xml示例:

<build>
  <buildType id="HelloWorld_A"/>
    <lastChanges>
      <change id="760"/>
    </lastChanges>
</build>

有关详细信息,请参阅文档中的相关section

相关问题