【问题标题】:In Azure Devops Release Pipeline, how can I get the name of the build associated with the release?在 Azure Devops Release Pipeline 中,如何获取与发布关联的生成的名称?
【发布时间】:2020-08-21 10:12:52
【问题描述】:

我在 Azure Devops 中有一个发布管道。在发布管道中,我有一个引用变量 $(Release.Artifacts.MyCustomAlias.BuildNumber) 的 bash 脚本步骤。在脚本中,我回显了变量的值。

现在我创建了一个新版本并选择构建 20200820.22 作为工件。

在检查脚本的输出时,它使用的值是 20200821.2,这是最新版本,但不是我选择的版本。

如何从发布脚本访问正确的构建版本?

【问题讨论】:

    标签: azure-devops azure-pipelines azure-pipelines-release-task


    【解决方案1】:

    我试图重现你的情况。

    对于这个脚本:

    Write-Host $(Build.BuildNumber)
    
    Write-Host $(Release.Artifacts.CustomName.BuildNumber)
    

    我得到了正确的结果:

    而且由于最新版本是20200821.1,它选择了正确的数字。请尝试$(Build.BuildNumber),它适用于主要工件。

    【讨论】:

      猜你喜欢
      • 2021-10-29
      • 1970-01-01
      • 2020-02-22
      • 1970-01-01
      • 1970-01-01
      • 2022-08-21
      • 2019-10-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多