10

I want to change release names like V.1.0.00 for manual release in Continuous Delivery of Azure DevOps but i can't able to delete or change the naming without this $(rev:r), how can I use a custom name?

Default Name: Release- $(rev:r)

Required Name: V.1.0.0

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
Vignesh Arvind
  • 531
  • 2
  • 7
  • 16
  • Probably a duplicate https://stackoverflow.com/questions/51746260/vsts-customize-release-name-format – TrevorBrooks Sep 13 '19 at 17:01
  • You may need to understand the `$(rev:r)` token first. To ensure that every completed build/release has a unique name. When a build/release is completed, if nothing else in the number has changed, the Rev integer value is incremented by one. So, basically we cannot achieve that without using `$(rev:r)`, unless you can defined a token which has the same function with `$(rev:r)`. You can try the the following solutions, they should did the trick. – Andy Li-MSFT Sep 26 '19 at 07:52
  • See https://stackoverflow.com/questions/62176262/pass-build-version-to-release/62176728#62176728 (you set the build id in your build and reference `$(Build.BuildId)` in your release name format. – Marc Jun 03 '20 at 15:33

3 Answers3

12

In the build Pipeline.

You can customize how your pipeline runs are named/numbered. Ref : https://learn.microsoft.com/en-us/azure/devops/pipelines/process/run-number?view=azure-devops&tabs=yaml

In YAML, this property is called name.

Use variables to set your major version, minor version etc and generate the patch version using counter Ref : https://learn.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops#counter.

for your case you can set major : V.1 minor : 0 patch : $[counter(format('{0}.{1}', variables['major'], variables['minor']), 1)]

and set the name like name: $(major_version).$(minor_version).$(patch_version)

Release pipeline

Refer to $(Build.BuildNumber) which will ref to the buildpipeline custom name/number set in the build pipeline. You can change this naming scheme by editing the release name format mask. In the Options tab of a release pipeline, edit the Release name format property in the General page. Ref : https://learn.microsoft.com/en-us/azure/devops/pipelines/release/?view=azure-devops#how-do-i-manage-the-names-for-new-releases.

Michael George
  • 647
  • 9
  • 15
3

You can change the naming scheme by editing the release name format mask.

When specifying the format mask, you can use the pre-defined variables mentioned in this official document or custom variable -- the value of a global configuration property defined in the release pipeline.

But for your issue ,as far as I know, no pre-defined variables can be displayed like V1.0.0 as release name.

Hugh Lin
  • 17,829
  • 2
  • 21
  • 25
1

You can't. release name must be a unique name, therefore Azure DevOps requires you to put $(rev:r) in the name, because it's adding a incremental number for each release.

Another option is to use $(Build.BuildNumber) or $(Release.ReleaseId) that are also unique but is not will solve your issue.

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114