Thursday, November 17, 2011

TFS Build 2010: BuildNumber and DropLocation

Automatic Builds for Application Release is a current practice in every major development factory nowadays.

Using Team Foundation Server Build 2010 to accomplish this offers many opportunities to improve quality of your releases.

The following approach allow us to generate build drop folders including the BuildNumber and the Changeset or Label provided. Using this procedure we can quickly identify the generated binaries in the Drop Server with the corresponding Version.

  1. Branch the DefaultTemplate.xaml and renamed it with CustomDefaultTemplate.xaml

image

  1. Open it for edit (check out)
  2. Go to the Set Drop Location Activity and edit the DropLocation property.

image

  1. Write the following expression:

BuildDetail.DropLocationRoot + "\" + BuildDetail.BuildDefinition.Name + "\" + If(String.IsNullOrWhiteSpace(GetVersion), BuildDetail.SourceGetVersion, GetVersion) + "_" + BuildDetail.BuildNumber

  1. Check in the branched template.
  2. Now create a build definition named TestBuildForDev using the new template.

The previous expression sets the DropLocation with the following format: (ChangesetNumber|LabelName)_BuildName_BuildNumber

The first part of the folder name will be the changeset number or the label name (if triggered using labels). Folder names will be generated as following:

  1. C1850_TestBuildForDev_20111117.1 (changesets start with letter C)
  2. LLabelname_TestBuildForDev_20111117.1 (labels start with letter L)

Try launching a build from a Changeset and from a Label. You can specify a Label in the GetVersion parameter in the Queue new Build Wizard, going to the Parameters tab (for labels add the “L” prefix):

image

Evento Gratuito de Arquitectura / Architecture Event

El próximo 29 de noviembre voy a participar como orador en Microsoft en este evento gratuito sobre Herramientas de desarrollo y patrones de Arquitectura. Vamos a tomar varios temas interesantes sobre Arquitectura y construcción de Frameworks de Desarrollo.

Si están interesados en asistir, se pueden comunicar conmigo a través de un comentario en este blog.

English: Next November 29th I will be participating as a speaker in a free admission event at Microsoft México offices. We will be discussing very interesting topics about Architecture and the development of Technical Frameworks.

image