且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

VSTS-自定义发布名称格式

更新时间:2023-09-17 19:25:16

关于自定义vsts版本名称格式的问题的解决方案位于下一页的主要工件变量下

The solution to my question on customizing the vsts release name format was found on following page under Primary artifact variables

https://docs. microsoft.com/en-us/vsts/pipelines/release/variables?view=vsts&tabs=powershell

预定义的变量Build.Buildnumber与Release.Artifacts.{主要工件别名} .BuildNumber相同. 就我而言,我使用了 $(Build.BuildNumber)-$(rev:r)来获得所需的结果.

The predefined variable Build.Buildnumber is the same as Release.Artifacts.{Primary artifact alias}.BuildNumber. In my case I used $(Build.BuildNumber)-$(rev:r) to get the desired result.

起初,这不起作用,因为我有多个工件.确保选择正确的工件作为主要工件.

At first this was not working because I had multiple artifacts. Make sure you select the right artifact as primary artifact.