如何将内部版本号放入 Azure DevOps 中的构建管道项目的名称中?
How do I get the build number into the name of the build pipeline artifact in Azure DevOps?
我正在 Azure DevOps 中构建一个 .NET 应用程序,通过 Cake 脚本使用 GitVersion 设置其版本,然后构建它。它似乎是从 GitVersion 中创建的这个值中获取内部版本号的。我希望信息内部版本号填充我姓名的一部分。我正在使用设计器,但为了便于使用,这里是发布工件步骤的 YAML 文件:
#Your build pipeline references the ‘deployment.PPILDeployDirectory’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
#Your build pipeline references the ‘deployment.integration.environment’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
steps:
- task: PublishBuildArtifacts@1
displayName: 'Publish Integration Artifact copy'
inputs:
PathtoPublish: '$(deployment.PPILDeployDirectory)'
ArtifactName: '$(deployment.integration.environment)_integration_drop'
如何为我的 ArtifactName 添加信息性内部版本号(包括分支和内部版本信息)后缀?我需要抓取的变量是什么?是否有任何其他我应该注意的与内部版本号相关的变量?
How do I suffix my ArtifactName with the informational build number (which includes the branch and build information)?
您可以使用变量 $(Build.BuildNumber)
和 $(Build.SourceBranchName)
作为您的 ArtifactName 的后缀,例如:
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: dist'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'Test_$(Build.BuildNumber)_$(Build.SourceBranchName)'
构建后,我们可以在摘要选项卡下看到日志,构建号为20190425.7
,源分支为master
。
可用变量列表位于:
希望对您有所帮助。
我正在 Azure DevOps 中构建一个 .NET 应用程序,通过 Cake 脚本使用 GitVersion 设置其版本,然后构建它。它似乎是从 GitVersion 中创建的这个值中获取内部版本号的。我希望信息内部版本号填充我姓名的一部分。我正在使用设计器,但为了便于使用,这里是发布工件步骤的 YAML 文件:
#Your build pipeline references the ‘deployment.PPILDeployDirectory’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
#Your build pipeline references the ‘deployment.integration.environment’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
steps:
- task: PublishBuildArtifacts@1
displayName: 'Publish Integration Artifact copy'
inputs:
PathtoPublish: '$(deployment.PPILDeployDirectory)'
ArtifactName: '$(deployment.integration.environment)_integration_drop'
如何为我的 ArtifactName 添加信息性内部版本号(包括分支和内部版本信息)后缀?我需要抓取的变量是什么?是否有任何其他我应该注意的与内部版本号相关的变量?
How do I suffix my ArtifactName with the informational build number (which includes the branch and build information)?
您可以使用变量 $(Build.BuildNumber)
和 $(Build.SourceBranchName)
作为您的 ArtifactName 的后缀,例如:
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: dist'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'Test_$(Build.BuildNumber)_$(Build.SourceBranchName)'
构建后,我们可以在摘要选项卡下看到日志,构建号为20190425.7
,源分支为master
。
可用变量列表位于:
希望对您有所帮助。