gpt4 book ai didi

azure-devops - VSTS : Can I access the Build variables from Release definition?

转载 作者:行者123 更新时间:2023-12-03 23:29:49 25 4
gpt4 key购买 nike

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

这可能吗?如果是这样,如何?

最佳答案

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

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

关于azure-devops - VSTS : Can I access the Build variables from Release definition?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50905024/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com