构建计数器 - Visual Studio 团队服务
Build Counter - Visual Studio Team Services
在 Team City 中,有构建计数器的概念。每次执行构建时计数器都会递增,并且范围限定为单个构建定义 - 因此调用构建定义 A 不会更新构建定义 B 的计数器,反之亦然。
在 Visual Studio 团队服务(Visual Studio 在线)构建中,有一个 $Env:BUILD_BUILDNUMBER 但这个数字似乎在全球范围内适用于所有构建定义。
为了使用 semver major.minor.patch
标记我的构建和后续的 nuget 包,我想访问像构建计数器这样的 teamcity,范围限定为单个构建定义。
我宁愿不使用脚本来更新每个构建商店的某些文件或基于 http,对于 Team City 中开箱即用的东西来说,这感觉像是很多工作。
您可以在构建定义设置的 "General" 选项卡下更新 "Build number format" 以使用“$(Rev:.r)”作为构建编号,如下所示:
major.minor$(Rev:.r)
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.
If you want to show prefix zeros in the number, you can add additional
r characters. For example, specify $(rev:.rr) if you want the Rev
number to begin with 01, 02, and so on.
参考这个link了解详情:Build Number Format。
在 Team City 中,有构建计数器的概念。每次执行构建时计数器都会递增,并且范围限定为单个构建定义 - 因此调用构建定义 A 不会更新构建定义 B 的计数器,反之亦然。
在 Visual Studio 团队服务(Visual Studio 在线)构建中,有一个 $Env:BUILD_BUILDNUMBER 但这个数字似乎在全球范围内适用于所有构建定义。
为了使用 semver major.minor.patch
标记我的构建和后续的 nuget 包,我想访问像构建计数器这样的 teamcity,范围限定为单个构建定义。
我宁愿不使用脚本来更新每个构建商店的某些文件或基于 http,对于 Team City 中开箱即用的东西来说,这感觉像是很多工作。
您可以在构建定义设置的 "General" 选项卡下更新 "Build number format" 以使用“$(Rev:.r)”作为构建编号,如下所示:
major.minor$(Rev:.r)
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.
If you want to show prefix zeros in the number, you can add additional r characters. For example, specify $(rev:.rr) if you want the Rev number to begin with 01, 02, and so on.
参考这个link了解详情:Build Number Format。