VSTS:我可以从Release定义访问Build变量吗? [英] VSTS : Can I access the Build variables from Release definition?

查看:62
本文介绍了VSTS:我可以从Release定义访问Build变量吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VSTS CI/CD中,我正在CI中的Powershell任务中设置一些变量的值. 在CD期间,我想访问该变量的值以执行某项操作,比如说echo.

In VSTS CI/CD , I am setting some variable's value in a Powershell task in CI. During CD I want to access that variable's value to do something , lets say echo.

这可能吗?如果是这样,怎么办?

Is this possible? If so, how?

推荐答案

您可以将其写到json/xml文件中,然后将该文件包含在您的构建定义的已发布工件中.然后通过PowerShell在您的发行版定义中读取该文件.

You could write it out to a json/xml file and include that file in your published artifacts of your build defintion. Then read in that file via PowerShell in your release definition.

ConvertTo-Json | Out-File "file.json"
Get-Content "file.json" | ConvertFrom-Json

这篇关于VSTS:我可以从Release定义访问Build变量吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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