Home > ALM, TFS > TFS2012: Create Build Definitions

TFS2012: Create Build Definitions


Introduction

In this article I will explain how to create a build definition in the Visual Studio 2012 and TFS 2012 server. I used TFS 2012 Express when I wrote this post. In a previous post, I went through the build types that Team Foundation Server supports.

To run a Team Build in TFS, assuming you already setup the Build Controller and Agents, you need to create a build definition. A build definition acts as a settings or configurations file for the build process.

Create Build Definition

The following steps show how to create a team build definition:

Open Visual Studio 2012

Open Team Explorer (View—>Team Explorer)

Connect to a TFS Server and Team Project

image

After you are connected to the Team Project of interest, go back to the Home menu or page and click on the Builds link

image

Click New Build Definition to create a new build definition

image

Give your build definition a meaningful name (e.g. mypp-CI-Debug, myapp-Scheduled-UnitTests).

Queuing process option is sufficiently explained on the screen.

image

Click on the Trigger node

On this screen, you can specify the build type. Build types were covered in the previous article. Under Rolling builds, Build no more often than ever x minutes means you want at least x minutes between builds to allow for build accumulation. Under Gated Check-in, check the Merge and build up to x submissions, if you want to group submissions when building them to improve performance.

image

The next step is to configure the Workspace.

On this screen, you can select as many folders as you want. Those folders and their contents will be downloaded (Get performed) to the Source Directory to the code. As a best practice, you want to avoid referencing the root folder of you team project (e.g. $/MyTeamProject) because you want to avoid getting the code for unrelated files or projects. Point to the folder where your code exists and add other folders for other related code or libraries such as libraries for third party controls. When adding multiple folders, make sure you maintain the folder level or relative path among folders at the Build Agent Folder.

image

Click on the Build defaults, it is probably called with that name because you can override these values when you queue a build <— I am guessing :)

On this screen, you have to specify a Build a controller and the drop folder location. The drop folder contains the output of the build process.

image

The Process screen is where you can define the Build process Template, which is a workflow of activities to execute your team build, and the Build process parameters that are passed to the workflow build template as arguments.

image

If you are using the Default Template, you need to at least populate the Items to Build parameter with a solution. Deferent build templates may have deferent parameters. You can also create and customize a build template.

Click the ellipsis button

Click on Add

Select a solution

You can select multiple solutions

You can set the configurations for the build in the Configurations tab

image

In another post, I will explain the other parameters.

The last step, is to define the retention policy. The retention policy automate the deletion of old builds to save disk space.

Save the build definition

Notice that it will be added to the build definition section on the build window. To queue a build manually, right click and click on Queue New Build

image

About these ads
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 391 other followers

%d bloggers like this: