Start Command (Team Foundation Build)

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

Required Permissions

To use the start command, you must have the Queue builds and View build definition security permissions in Visual Studio Team Foundation Server 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.

TFSBuild start /collection:teamProjectCollectionUrl 
/builddefinition:definitionSpec [/droplocation:droplocation] [/getoption:getoption] 
[/customgetversion:versionSpec] [/priority:priority] [/requestedfor:userName] 
[/msbuildarguments:args] [/shelveset:shelvesetName [/checkin]] 
[/silent] [/queue]

TFSBuild start teamProjectCollectionUrl teamProject definitionName 
[/droplocation:droplocation] [/getoption:getoption] [priority:priority]
 [/customgetversion:versionSpec] [/requestedfor:userName]
[/shelveset:shelvesetName [/checkin]]
[/msbuildarguments:args] [/silent] [/queue]

Parameters

Argument

Description

teamProjectCollectionUrl

URL of the team project collection that contains the solutions and projects that are being built.

teamProject

Name of the team project that contains the solutions and projects being built.

definitionName

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

droplocation

Path to the public folder where the build's binaries and log files are stored after the build is completed. For example, \\server\share. This is used with the /droplocation option.

getoption

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

versionSpec

  • Versionspec that specifies the files that you want to build when you set /getoption to Custom. You use this command with the /customgetversion option. For more information about versionspec syntax, see Command-Line Syntax (Version Control).

priority

Queue priority to use for the build definition. You use this argument with the /priority option.

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

userName

Name of the user whom you want to associate with the completed build.

args

Command-line arguments to pass to MSBuild.

shelvesetName

Specify the name of a shelveset if you want to start a private build or are starting a build that is defined with the gated check-in trigger.

Option

Description

/collection

Specifies the team project collection.

/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 you select the build directory, make sure that the build space is sufficient because insufficient space will lead to canceled builds.

/getoption

Optional. Specifies the files that you want to get from version control.

/customgetversion

Optional. Specifies the custom version of files that you want to get if you specify the value of /getoption 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"

/shelveset

Optional. Specify the name of a shelveset if you want to start a private build or are starting a build that is defined with the gated check-in trigger.

/checkin

Optional. This option applies only if you are starting a build that is defined with the gated check-in trigger. Specify this option if you want the system to check in the files if the build is successful.

/silent

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

/queue

Inserts the build's 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 you determine 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 test results. You must manually establish a share and add write permissions to the Windows directory and share permissions for both the account that is 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 in the team project collection at http://myserver:8080/DefaultCollection. The resulting build is located in the BuildDrop directory.

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

The following example builds the Nightlies build type that is in the AdventureWorks team project in the collection at http://myserver:8080/DefaultCollection. The resulting build is 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://myserver:8080/DefaultCollection /builddefinition:"AdventureWorks\Nightlies" /droplocation:"\\computername\buildDrops" /msbuildarguments:"/flp:verbosity=diag"

See Also

Tasks

Create a Basic Build Definition

Concepts

Run and Monitor Builds

Define Your Build Process

Other Resources

Team Foundation Build Commands