TFS Online - start $(Rev.r) from 0

我的未来我决定 提交于 2019-12-24 05:47:11

问题


I am using $(Rev:.r) in my build number.

Major.Minor$(Rev:.r)

This works perfect and increments on every build and gets reset if the the major or minor version gets changed.

But the numbering starts at 1 and not 0. So the first build is not 1.0.0 but 1.0.1 which is not really what I am going for.

So is there a way to make the Revision start at 0?

Thanks for the help...

P.S. Unfortunately it is not possible to use Git and GitVersion in this project.


回答1:


No, this can't be achieved.

What is the Rev?

Use $(Rev:.rr) to ensure that every completed build has a unique name. When a build is completed, if nothing else in the build number has changed, the Rev integer value is incremented by one.

Source Link: Build number format

Moreover, anytime you change your Build Number in a TFS build, the revision resets to 1. It' by default, you could not change this value. Since if you could be able to set the value start from 0, it's also should be able to set it start from 100. This will mess up the build number.




回答2:


As a workaround to reset the revision number, you could create a clone of the existing build definition and kick off a new build with the recently created definition. This will initiate a new build starting at revision # 1.

Here is how to clone the build definition, click on the 3 dots next to the definition title under Build definitions page. Refer the screenshot below;

Click here to view screenshot - clone a definition

As like 1.0.0.1 if you have set the format to be 1.0.0$(rev:.r) in the build format field.

Otherwise resetting the revision # within a build definition isn't possible. I have tried deleting earlier builds and also tried manually setting the build number to 1.0.0.0 to reset but nothing worked.



来源:https://stackoverflow.com/questions/40898003/tfs-online-start-rev-r-from-0

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!