有没有一种方法可以在VSTS Release Management中进行嵌套变量 [英] Is there a way to do nested variables in VSTS Release Management

本文介绍了有没有一种方法可以在VSTS Release Management中进行嵌套变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在变量组中创建了一些具有以下名称的变量:

I have a few variables created in Variable Groups with the following names:

CodeNetworkShare.Dev
CodeNetworkShare.Test
CodeNetworkShare.Prod

我在发布定义"中导入了此变量组.然后,我尝试了以下方法在发行版定义中使用它

I imported this variable group in my Release Definition. Then I tried the following ways to use this in Release definition

  1. 我在发布定义"中创建了一个局部变量,如下所示:

  1. I created a local variable in the Release Definition as follows:

名称= CodeNetworkShare1 值= $(CodeNetworkShare.$(Release.EnvironmentName))

Name = CodeNetworkShare1 Value = $(CodeNetworkShare.$(Release.EnvironmentName))

我尝试使用以下表达式直接在任务中使用它:

I tried to use it directly in the task using the following expression:

$(CodeNetworkShare.$(Release.EnvironmentName))

$(CodeNetworkShare.$(Release.EnvironmentName))

以上两种方法均无效.我还有其他方法可以使它正常工作吗? VSTS Release Definitions是否嵌套变量?如果目前不支持此功能,将来有计划支持吗?

Neither of the above approaches worked. Is there any other way I can get this to work? Does VSTS Release Definitions nested variables? If it's not supported at the moment are there plans to support this in the future?

推荐答案

VSTS现在可以选择将变量组链接到同一版本定义中的不同环境.为每个环境(开发,测试,生产,或者可能只是开发和生产,如果例如测试在生产环境中)创建单独的变量组,然后在链接页面中将该组链接到正确的环境.在此处查看其他答案中的更多信息:

VSTS now has the option of linking variable groups to different environments within the same release definition. Create separate variable groups for each environment (dev, test, prod, or maybe just dev and prod, if e.g. test is in production environment) and then link that group to correct environments in the link page. See more in my other answer here: Is there a way to use VSTS Variable Groups per environment?

这篇关于有没有一种方法可以在VSTS Release Management中进行嵌套变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆