简体   繁体   English

如何在 azure 构建到发布管道中将变量从构建传递到发布

[英]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.

相关问题 如何使用终端从bash脚本构建发行版APK - How to build release apk from a bash script using terminal Azure生成管道Bash脚本现在可以正确设置生成变量 - Azure Build Pipeline Bash Script now setting build variable properly 如何使用 Bash 将资产从 Azure 发布管道上传到 Github Enterprise - How to upload an asset from Azure Release pipeline to Github Enterprise using Bash 在 azure devops 管道 docker 构建任务中将文件内容作为构建参数传递 - Pass file content as build argument in azure devops pipeline docker build task 将更改推送到 GitHub 存储库作为 Azure DevOps 中发布管道的一部分 - Push changes to GitHub repository as a part of release pipeline in Azure DevOps Azure 构建管道未将文件映射到 Docker 卷 - Azure Build Pipeline Not Mapping Files to Docker Volume 将变量构建参数传递给 docker 构建命令 - Pass variable build args to docker build command 发布.NET Core时未创建Release版本的文件夹 - Folder for Release build does not get created when publishing .NET Core 在Azure Devops中为基于Python的Azure Function设置发布管道的正确方法 - Proper way to set up a release pipeline in Azure Devops for Python based Azure Function 如何从docker build参数构建bash变量 - how to build a bash variable from docker build arguments
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM