TeamCity Nant REST 身份验证
在 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>
我确信 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.
代理任务配置是否不正确?
In TeamCity, is there any way to pull all the pinned artifacts from a Build Configuration rather than just the last pinned build?
EDIT:
Thanks to redsquares advice, I am attempting to solve this problem using the REST API with Nant.
I have changed from getting the pinned builds, to builds with specific tags, as this allows me to configure multiple lists if needed.
I thought I could just use the get task in Nant as follows and then follow that with the xmlpeek task to gather the information from the xml file:
<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>
I am positive the uid and pwd are correct. Despite this I keep getting the following error:
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.
Is the Proxy task configured incorrectly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 teamcity 6 中,您可以使用其余 API 来获取项目的工件。
您可以编写一个 powershell 脚本来连接到其余 api 并获取所有固定的构建,然后下载这些构建的工件。
更多信息和选项请此处。
In teamcity 6 you can use the rest API to grab the artifacts for a project.
You could write a powershell script to connect to the rest api and get all pinned builds then download the artifacts for those builds.
More info and options here.