【发布时间】:2016-11-17 22:13:54
【问题描述】:
我有一些构建。每个构建都有两个标签。标签显示模块名称和版本。所以标签看起来像one-module和1.2.3或two-module和4.5.6。
我可以这样做:
/httpAuth/app/rest/builds/?locator=tags:one-module,branch:unspecified:any&fields=build(tags(tag))
我会得到这个:
{
"build": [
{
"tags": {
"tag": [
{
"name": "1.2.4"
},
{
"name": "one-module"
}
]
}
},
{
"tags": {
"tag": [
{
"name": "1.2.3"
},
{
"name": "one-module"
}
]
}
}
]
}
现在我想获得带有标签one-module 和1.2.4 的最新版本。我该怎么做?
我试试这个:
/httpAuth/app/rest/builds/?locator=tags:one-module,1.2.4,branch:unspecified:any&fields=build(tags(tag))
但我得到了这个:
Error has occurred during request processing (Bad Request).
Error: jetbrains.buildServer.server.rest.errors.LocatorProcessException: Bad locator syntax: Invalid dimension name :'1.2.4'. Should contain only alpha-numeric symbols or be known one. Details: locator: 'tags:one-module,1.2.4,branch:unspecified:any', at position 16
Invalid request. Check locator is specified correctly.
我有 TeamCity 版本 9.1.6。 TeamCity REST API BuildLocator documentation 说:
tags: - ","(comma) - 构建标签的分隔列表(仅构建 包含所有指定的标签被返回)
所以,我尝试选择这样的 2 个或更多标签构建。这不起作用?
我做错了什么?如何通过 2 个或更多标签获取最新版本?
【问题讨论】:
标签: rest teamcity teamcity-9.0 teamcity-rest-api