Where is TFS 2010 Team Build Revision $(Rev:.r) Stored?

后端 未结 2 1271
日久生厌
日久生厌 2020-12-19 04:07

TFS 2010 exposes a "Build Number Format" property, which contains $(BuildNumberDefinitionName) and $(Rev:.r) variables (among other things). Two and a half parts

相关标签:
2条回答
  • 2020-12-19 04:45

    Open a build definition, go process tab, find "Build Number Format" section and click "..." button at end of it. Here you will see a "Macros>>" button that contains all available variables. As far as I know $(Rev:.r) tells that it's Nth time that this definition has been run in a specific date. It is store in TFS internal database.

    0 讨论(0)
  • 2020-12-19 05:08

    http://www.richardmaxwell.name/blog/2011/5/5/force-tfs-build-revision-to-a-specifc-value.html

    Anytime you change your Build Number in a TFS build, the revision resets to 1, which is what it should do, most of the time. But sometimes, you want to start at revision 100, maybe recreating a deleted build definition, or just wanting to maintain the old revision into a new branch. It took me a lucky accident to discover how this is possible. You must replace the dynamic revision with a hard coded one, build, and then change it back. Out of frustration I eventually tried this:

    Build Number Format: 1.0.0.100

    This gave me the build I wanted, and then changed it back to this:

    Build Number Format: 1.0.0$(Rev:.r)

    This picked up my last value, starting future build at 1.0.0.101, instead of incrementing the last version that it had used, 1.0.0.2. So I was able to skip builds 1 through 99 and start at revision 100 in my build number.

    0 讨论(0)
提交回复
热议问题