views:

19

answers:

1

I use VS 2008, Team Explorer and TFS. I'm looking to automate your builds by executing TFSBuild.exe command.

I follow those steps:

Open TeamExplorer, in VS2008, connected to TFS;

My Team Project has a Build (named MainBuild) in Builds. Then, I do Query New build option.

I fill the properties in window dialog opened:

build Definition: Mainbuild

Build Agent: Machine1BuildAgent

drop folder for this build: \Machine1\Build_drop

priority in queue: Normal

MsBuild command-line arguments:

/p:BuildAll=false /p:RunTest=false /p:SkipClean=true /p:SkipGet=true /p:SkipLabel=true /p:SkipGetChangesetsAndUpdateWorkItems=true

In MDSN I have seen TFSBuild command and this sample:

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

TFSBuild start http://server01:8080 AdventureWorks Nightlies /m:Machine1 /d:"C:\BuildDrop"

edit: Now, for my issue, how can I do automation for build MainBuild for set the values for "MsBuild command-line arguments" using TFSBuild.exe command ? I'm looking for a way to automatically have the TFS Build Agent job run nightly with command-line arguments..

I need similar command line like this:

TFSBuild start http://machine01:8080 MyteamProject MainBuild /m:Machine1 /d:"\Machine1\Build_drop" /p:BuildAll=false /p:RunTest=false /p:SkipClean=true /p:SkipGet=true /p:SkipLabel=true /p:SkipGetChangesetsAndUpdateWorkItems=true

I need pass the arguments (MsBuild command-line arguments) to TFSBuild.exe command and automatize the TFS build.

any sample scripting code ?

+1  A: 

I'm not sure I understand your question clearly, but if you're looking to automate your builds by executing MSBuild from the command-line, you can create a batch file to execute the necessary command using the command-line arguments you want. Then add a scheduled task to 'Scheduled Tasks' in Windows so that this batch file is executed on a regular (e.g. nightly) basis.

Bernard
I think he's actually looking for a way to automatically have the TFS Build Agent job run nightly *with command-line arguments*, but I'm using the technique you describe for our newer pre-release product.
DaveE
I need pass the arguments (MsBuild command-line arguments, from Query New build window-dialog) to TFSBuild.exe command and automatize the TFS build.
alhambraeidos