Customize TFS build definition template

406 Views Asked by At

QUERY: I want to create a build definition template on TFS that would keep a check on the files being checked in. I want to retrieve the path of the files that are being checked in and these files should be saved to the SQL server.

WHY DOING THIS: I want to search the files (contents of the file also) on TFS and show the relevant file(s) to the end user based on the search term. As we know TFS saves Data to SQL server but doesn't stores in a way that we can use SQL full text index. So, I am planning to save the files to the SQL server using the TFS Build definition template that would watch the files being checked in and save the file to the SQL Server.

Please help with any pointers on TFS build definition template on how get the path of files on TFS and how to trigger the save event to SQL server.

Thanks in Advance.

1

There are 1 best solutions below

0
On
  1. Install a build controller and register at least one build agent (prerequisite for the TFS build system).
  2. Create a new build definition and set the trigger to "Gated check-in".
  3. Download the default process template and modify it. Follow the instructions over here: Customize your build process template.
  4. Remove everything that belongs to calling MSBuild from the workflow (inside the "Run on agent" activity).
  5. Create your own activity and put it there. The activity should use the downloaded sources, inspect them and write build errors if something is not to your liking. (see Use and develop custom build process activities)