本文介绍了VSTS Rest API-创建发行版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想利用此处定义的VSTS Rest API开始发布: https://www.visualstudio. com/en-us/docs/integrate/api/rm/releases#create-a-release

I'd like to start a release leveraging the VSTS Rest API defined here:https://www.visualstudio.com/en-us/docs/integrate/api/rm/releases#create-a-release

但是在创建发行版时,我需要设置一些变量值.查看ReleaseMetadata( https://www.visualstudio .com/en-us/docs/integrate/api/rm/contracts#ReleaseStartMetadata ),我看到有一个属性集合.这是我要设置变量值的地方吗?我需要在属性名称中使用任何特殊的命名约定来将其转换为变量名称吗? (例如## VSTS:[])??

but I need to set some of the variable values when I create the release.Looking at the ReleaseMetadata (https://www.visualstudio.com/en-us/docs/integrate/api/rm/contracts#ReleaseStartMetadata) I see there is a properties collection. Is this where I'd set the variable values? Is there any special naming convention I need to use in the property name to translate it the variable name? (like ##VSTS:[])??

推荐答案

现在,您可以将VSTS Release变量定义为可在发布时设置",如下所示.

Now you can define VSTS Release variables to be "Settable at release time" as shown below.

然后,您可以在 VSTS REST API调用请求正文传递在创建发行版时要设置的变量值.

Then you can use below json syntax in VSTS REST API call request body to pass the variable values to set at the time of creating the release.

"variables": {
    "Variable1Name": {
      "value": "Variable1Value"
    },
    "Variable2Name": {
      "value": "Variable2Value"
    }
  }

有关更多信息,请参见在此处发布.

For more information refer the post here.

这篇关于VSTS Rest API-创建发行版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 20:07