Start Command (Team Foundation Build)

Use the start command to run a configured Team Foundation Build build definition.

Required Permissions

To use the start command, you must have the Team Foundation Server Start a build security permission set to Allow. Additionally, the application-tier service account and the Team Foundation Build service account must have read/write permissions to the build drop location. For more information, see Team Foundation Server Permissions.

Note

Even if you are logged on with administrative credentials, you must open an elevated Command Prompt to perform this function on a server that is running Windows Server 2008. To open an elevated Command Prompt, click Start, right-click Command Prompt, and click Run as Administrator. For more information, see the Microsoft Web site.

TFSBuild start /server:teamFoundationServer 
/builddefinition:definitionSpec [/droplocations:dl] [/getoption:go] 
[/customgetversion:versionSpec] [/priority:p] [/requestedfor:userName] 
[/msbuildarguments:args] [/silent] [/queue]

TFSBuild start teamFoundationServer teamProject definitionName 
[/droplocation:dl] [/getoption:go] [priority:p]
 [/customversion:versionSpec] [/requestedfor:userName]
[/msbuildarguments:args] [/silent] [/queue]

Parameters

Argument

Description

teamFoundationServer

Team Foundation server URL where the solutions being built are checked in.

teamProject

Team project name that has the solutions to be built.

definitionName

Name of the build definition in the team project to use for the build.

dl

Path to the public folder where the builds binaries and log files are stored once the build is complete. For example, //server/share. This is used with the /droplocations option.

go

Used with the /getoption option.Valid where the values are LatestOnQueue, LatestOnBuild and Custom.

versionSpec

Version of files to build when the /getoption is set to Custom. This is used with the /customgetversion option.

You can specify a version by:

  • Date/time (D10/20/2005)

  • Changeset version (C1256)

  • Label (Lmylabel)

  • Latest version (T)

  • Workspace version (Wworkspacename;owner)

p

Queue priority to use for the build definition. This is used with the /priority option.

Valid values are: Low, BelowNormal, Normal, AboveNormal, and High.

userName

User who is requesting the build.

args

Command-line arguments to pass to MSBuild.

Option

Description

/droplocation

Optional. Specifies the directory where the build process occurs. It can be abbreviated as /d. By default, the build directory specified in the build definition is used.

NoteNote:
  When selecting the build directory, be sure there is sufficient space to build because insufficient space will lead to cancelled builds.

/getoption

Optional. Specifies the files to get from version control.

/customgetversion

Optional. Specifies the custom version of files to get if the value of /getoption is specified as Custom.

/priority

Optional. Specifies the build queue priority.

/requestedfor

Optional. Specifies for whom the build was requested.

/msbuildarguments

Optional. Specifies command-line arguments to pass to MSBuild.

The general format is:

/msbuildarguments:"/p:SomeProperty=SomeValue /t:MySpecialTarget"

/silent

Optional. When you specify this option, the output is not written to the Command Prompt window while the build is running.

/queue

Inserts the builds start request into the build queue and returns immediately.

Remarks

You can use the Team Foundation command-line command TFSBuild start with the Task Scheduler service to perform recurring or nightly builds.

If you build more than one solution, consider one solution having dependencies on another when determining the order in which they are built. For example, set Solution1 to be built before Solution2 in the case where Solution2 has a dependency on Solution1.

By default, the drop directory is not automatically created as a share. Therefore, it is not available for publishing builds and tests results. You must manually establish a share and add write permissions to the Windows directory and share permissions for both the account used to run the Team Build Service for dropping builds and for the tester's account for publishing test results.

Example

The following example builds the Nightlies build type that is in the AdventureWorks team project on server01. The resulting build is located in the BuildDrop directory.

>TFSBuild start http://server01:8080 /builddefinition:"AdventureWorks\Nightlies" /droplocation:"\\computername\buildDrops"

The following example builds the Nightlies build type that is in the AdventureWorks team project on server01. The resulting build is located in the BuildDrop directory. Use the /msbuildarguments option to pass in the MSBuild verbosity level of diagnostic. For more information, see MSBuild Command Line Reference.

>TFSBuild start http://server01:8080 /builddefinition:"AdventureWorks\Nightlies" /droplocation:"\\computername\buildDrops" /msbuildarguments:"/flp:verbosity=diag"

See Also

Tasks

How to: Start a Build from the Command Line

How to: Create a Build Definition

Other Resources

Team Foundation Build Commands

Running Builds in Team Foundation Build

Working with Build Definitions in Team Foundation Build