[英]How to pass variable from build to release in azure build to release pipeline
How to pass variable from build to release in azure build to release pipeline: We have variable in CI pipeline --> we have to pass that variable in Release pipeline--> that variable has to set in another yaml file.如何在 azure 构建到发布管道中将变量从构建传递到发布:我们在 CI 管道中有变量 --> 我们必须在发布管道中传递该变量 --> 该变量必须在另一个 yaml 文件中设置。 is this possible?
这可能吗?
For now, we could only set a variable in a variable group as a static value and use it in both build and release.目前,我们只能将变量组中的变量设置为static 值,并在构建和发布中使用它。
Detail ways please refer Marina's answer in this question: VSTS: Can I access the Build variables from Release definition?详细方法请参考 Marina 在这个问题中的回答: VSTS: Can I access the Build variables from Release definition?
But according to your description, what you want is to set the variable during the build and then use it in the release pipeline.但是根据您的描述,您想要的是在构建期间设置变量,然后在发布管道中使用它。
The is no official way to pass variables follow this.这不是传递变量的官方方式。 As a workaround, you could use some 3rd-partly extension, store the values in a file (json, xml, yaml, what have you) and attach that as a Build Artifact.
作为一种解决方法,您可以使用一些第 3 部分扩展,将值存储在文件中(json、xml、yaml,您有什么)并将其作为构建工件附加。 That way you can read the file in the release and set the variable again.
这样您就可以在发行版中读取文件并再次设置变量。
Take a look at this similar issue: How to get the variable value in TFS/AzureDevOps from Build to Release Pipeline?看看这个类似的问题: How to get the variable value in TFS/AzureDevOps from Build to Release Pipeline?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.