我有一些构建。每个版本都有两个标签。标签显示模块名称和版本。所以标签loogs喜欢one-module
和1.2.3
或two-module
和4.5.6
。如何通过TeamCity REST API指定多个标签来获取构建?
我可以这样做:
/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说:
标签: - “”(逗号) - 构建标签的分隔列表(仅适用于构建 包含所有指定标签返回)
所以,我尝试通过2个或更多标签来选择构建。这不行?
我做错了什么?如何通过2个或更多标签获得构建最新版本?