Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change custom release names in Azure DevOps?

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

like image 346
Vignesh Arvind Avatar asked Sep 13 '19 16:09

Vignesh Arvind


People also ask

How do I set variables in Azure DevOps release pipeline?

You define and manage these variables in the Variables tab in a release pipeline. In the Pipeline Variables page, open the Scope drop-down list and select "Release". By default, when you add a variable, it is set to Release scope. Share values across all of the tasks within one specific stage by using stage variables.

What is the difference between pipeline and release pipeline in Azure DevOps?

The Azure DevOps Server provides two different types of pipelines to perform build, deployment, testing and further actions. A Build Pipeline is used to generate Artifacts out of Source Code. A Release Pipeline consumes the Artifacts and conducts follow-up actions within a multi-staging system.

Are Azure DevOps release Pipelines deprecated?

Draft releases are deprecated in Azure Pipelines because you can change variables while you're creating the release. Creating a draft release allows you to edit some settings for the release and tasks, depending on your role permissions before you start the deployment.


3 Answers

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.

like image 99
Michael George Avatar answered Oct 24 '22 22:10

Michael George


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.

like image 3
Hugh Lin Avatar answered Oct 24 '22 22:10

Hugh Lin


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.

like image 1
Shayki Abramczyk Avatar answered Oct 24 '22 21:10

Shayki Abramczyk