Export (0) Print
Expand All

How to: Start a Build from the Command Line

You can use the TFSBuild start command to start a configured Team Foundation Build type from the command line.

Starting a build from the command line is a very useful way of running timed builds by including them in batch or script files. Before you run the TFSBuild start command, you must have the following information:

  • The name of the team project that contains the solution you want to build.

  • The name of the Team Foundation Build build type.

  • The URL of the Team Foundation server.

The following information is optional and if you do not provide values, the default values for the build type are used:

  • The name of the computer where the solutions are built.

  • The directory where the build files are stored.

For more information, see Start Command (Team Foundation Build).

Required Permissions

To complete this procedure, you must have the Team Foundation Server Start a build security permission set to Allow. For more information, see Team Foundation Server Permissions.

Starting a Build

The following procedure demonstrates the command-line syntax for starting a Team Foundation Build type.

To start a build type from the command-line

  1. Click Start, click All Programs, point to Microsoft Visual Studio 2005, point to Visual Studio Tools, and then click Visual Studio 2005 Command Prompt.

  2. At the command prompt type:

    <root>:\>TFSBuild start http://server01:8080 AdventureWorks Nightlies 

    Where the Team Foundation Build server, is the server specified by the build type, "Nightlies" and the built files are saved in the build drop location also specified by the build type. The <root> specifies the drive, usually "C". The "http://server01" specifies the URL for the Team Foundation server, "AdventureWorks" specifies the team project, and "Nightlies" specifies the Team Foundation Build type.

  3. You can optionally provide an alternative directory as a build drop location by typing the following at the command prompt.

    <root>:\>TFSBuild start http://server01:8080 AdventureWorks Nightlies /d:C:\BuildDrop

    Where the directory provided can be the one already configured for the build type "Nightlies", another directory, or a new directory that is created as the start command runs.

  4. You can also optionally provide a different Team Foundation Build server than the one configured by the build type "Nightlies". To change the default build computer type:

    <root>:\>TFSBuild start http://server01:8080 AdventureWorks Nightlies /m:SecondaryBuildComputer /d:C:\BuildDrop

    If the directory "C:\BuildDrop" does not exist, it is created.

Setting Up a Scheduled Build

The Team Foundation user interface in Team Foundation Server does not include an ability to run scheduled builds. However, you can access that functionality by using the Windows Task Scheduler service and the TFSBuild start command. For more information, see How to: Configure a Scheduled Build (Command Line).

See Also

Community Additions

© 2014 Microsoft