TeamCity Nant REST身份验证

bra*_*ogs 2 nant rest teamcity restful-authentication teamcity-5.0

在TeamCity中,有没有办法从构建配置中提取所有固定工件而不仅仅是最后一个固定构建?

编辑:感谢redsquares建议,我试图使用REST API与Nant解决这个问题.

我已经从获取固定版本更改为使用特定标记构建,因为这允许我根据需要配置多个列表.

我想我可以在Nant中使用get任务,如下所示,然后使用xmlpeek任务从xml文件中收集信息:

<get dest="tagged.xml" src="http://<teamcity_server>:1000/httpAuth/app/rest/buildTypes/id:bt103/builds?tag=release">
    <proxy host="<teamcity_server>" port="1000">
        <credentials username="uid" password="pwd"/>
    </proxy>
</get>
Run Code Online (Sandbox Code Playgroud)

我很肯定uid和pwd是正确的.尽管如此,我仍然收到以下错误:

Unable to download 'http://<teamcity_server>:1000/httpAuth/app/rest
/buildTypes/id:bt101/builds?tag=release' to 'H:\<path>\tagged.xml'.
    The remote server returned an error: (401) Unauthorized.
Run Code Online (Sandbox Code Playgroud)

Proxy任务配置错误吗?

red*_*are 19

在teamcity 6中,您可以使用其余API来获取项目的工件.

您可以编写一个powershell脚本来连接到其余的api并获取所有固定的构建,然后下载这些构建的工件.

更多信息和选项在这里.

  • 例如http:// <用户名>:<密码> @ <teamcity_server>:1000/httpAuth /参见http://confluence.jetbrains.net/display/TCD6/Accessing+Server+by+HTTP (2认同)