Use build numbers to give meaningful names to completed builds

You can define your build process to load useful data into the name of each completed build.

  • Example

  • Tokens

  • Q&A

    • Where do I specify the build number?

    • What is the BuildID?

    • What is the Rev?

Example

For example:

  • The team project is named FabrikamCore.

  • The build definition is named CIBuild.

  • The build ID is 4.

  • The date is August 24, 2009.

  • The time is 9:50:43 PM.

  • The build has been run one time today.

You define a default build process and set BuildNumberFormat to:

$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)

In this case, the second completed build on this day would be named:

CIBuild_20090824.2

Tokens

The following table shows how each token is resolved based on the previous example:

Token

Replacement value based on the example earlier in this section

$(BuildDefinitionName)

CIBuild

$(BuildID)

4

What is the build ID?

$(DayOfMonth)

24

$(DayOfYear)

236

$(Hours)

09

$(Minutes)

50

$(Month)

08

$(Rev:.rr)

02 (The next build on this day will be 03, and so on.)

What is the Rev?

$(Date:MMddyy)

082409

$(Seconds)

50

$(TeamProject)

FabrikamCore

$(Year:yy)

09

$(year:yyyy)

2009

Q&A

Where do I specify the build number?

You can:

What is the BuildID?

$(BuildID) is an internal immutable ID.

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.