简体   繁体   English

传递管道变量释放变量 Azure DevOps

[英]Pass pipeline variable to release variable Azure DevOps

Created CICD pipeline with trigger release, and Pipeline variable set in to Azure Devops Rest API. Getting variable in pipeline and set Output true using PowerShell.创建了带有触发器释放的 CICD 管道,并将管道变量设置为 Azure Devops Rest API。在管道中获取变量并使用 PowerShell 设置 Output 为真。

 Write-Host $(webAppName) 
echo "##vso[task.setvariable variable=webAppName;isoutput=true]$webAppName"

And set the release pipeline variable using WebAppName= ${{variables.webAppName}} on the variable tab.并使用变量选项卡上的 WebAppName= ${{variables.webAppName}} 设置发布管道变量。 It's not working, don't have idea how can we retrive the pipeline variable in release.它不起作用,不知道我们如何在发布中检索管道变量。

The is no official way to pass variables from Build to Release.这不是将变量从 Build 传递到 Release 的官方方法。

Using Variable Groups in Azure Pipeline Library is a good option: https://learn.microsoft.com/en-us/azure/devops/pipelines/library/variable-groups?view=azure-devops&tabs=yaml在 Azure 管道库中使用变量组是一个不错的选择: https://learn.microsoft.com/en-us/azure/devops/pipelines/library/variable-groups?view=azure-devops&tabs=yaml

Another work around, you could store the variable values in a file and attach that as a Build Artifact.另一种解决方法是,您可以将变量值存储在文件中并将其作为构建工件附加。 That way you can read the file in the release pipeline by downloading Build Artifacts and set the variable again.这样您就可以通过下载 Build Artifacts 读取发布管道中的文件并再次设置变量。 You could check my answer here: is there any way to pass variables from CI to CD pipeline你可以在这里查看我的答案: is there any way to pass variables from CI to CD pipeline

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure DevOps 发布管道 - 将环境变量传递给 docker 容器 - Azure DevOps Release Pipeline - Pass environment variable to docker container Azure DevOps 发布管道变量值未更新 - Azure DevOps Release Pipeline Variable Values are not updating 如何将变量传递给 Azure DevOps 运行管道 - How to pass variable to Azure DevOps Run Pipeline 在发布期间更新 Azure DevOps 发布管道变量 - Updating Azure DevOps Release Pipeline Variable During Release Azure DevOps:在经典模式下使用 Release Pipeline 时,我无法将变量的值传递给其他任务 - Azure DevOps : while using Release Pipeline in classic mode, I'm not able to pass the value of a variable to other tasks Azure Devops 发布管道 XML 变量替换不起作用 - Azure Devops Release Pipeline XML Variable Substitution not working 如何在 Devops 发布管道中的 Azure CLI 脚本中使用变量 - How to use variable in Azure CLI script within Devops release Pipeline 如何在 Azure Devops 发布管道中使用 PowerShell 设置环境变量? - How to set an environment variable with PowerShell in Azure Devops release pipeline? 将变量值从 Powershell 任务中的一个脚本传递到 Azure DevOps 发布管道中下一个 Powershell 任务中的另一个脚本 - Pass variable value from one Powershell script in Powershell task to another script in the next Powershell task in Azure DevOps Release Pipeline 如何将 Json 变量传递给 Azure DevOps 管道中的命令行任务? - How to pass Json variable to command line task in Azure DevOps pipeline?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM