【发布时间】:2022-02-16 23:51:08
【问题描述】:
使用 REST API,我可以轻松获取与给定构建对应的对象。但是在该构建排队时,它被赋予了构建变量。有些是在排队时设置的,有些是从构建定义继承的。
到目前为止,我还没有弄清楚如何评估这些构建变量。构建对象似乎不包含它们。
我可以清楚地看到parameters 属性中的顶级模板参数。但是构建变量在哪里?
编辑 1
我们使用 Azure DevOps 2020 的本地版本。它支持的最高 api 版本是 6.1-preview,并且该版本中的“Runs - Get”似乎没有太多回报。请注意:
C:\> Invoke-RestMethod "$TfsInstanceUrl/DFDevOps/_apis/pipelines/$($b.definition.id)/runs/$($b.id)?api-version=6.1-preview" -UseDefaultCredentials
_links : @{self=; web=; pipeline.web=; pipeline=}
pipeline : @{url=https://tdc1tfsapp01.dayforce.com/tfs/DefaultCollection/d85566a3-9e95-4891-9fd8-42750a0bc250/_apis/pipelines/8781?revision=19; id=8781; revision=19;
name=PRBuild Stress Test; folder=\}
state : completed
result : succeeded
createdDate : 2022-02-11T15:57:07.4271331Z
finishedDate : 2022-02-12T00:46:22.6090285Z
url : https://tdc1tfsapp01.dayforce.com/tfs/DefaultCollection/d85566a3-9e95-4891-9fd8-42750a0bc250/_apis/pipelines/8781/runs/1399783
resources : @{repositories=}
id : 1399783
name : 20220211.2
C:\>
这是否意味着这些变量仅在 Azure DevOps Services 中可用?
【问题讨论】: