how to automaticaly pin a build

Question

I'd like to know how I can configure Teamcity or write an MsBuild task to 'pin' a certain build, from another build configuration.

To clarify why I think I need this, I'll describe our context a bit :

Context

I'm setting up a development environment for a team that's quite new to looking beyond just coding.

- We're developping in VS (2008) a series of WCF services, that must be able to evelove independently of each other (even though they do use each other).

     --> this means that for each service there will always be only 1 version in production.  (framework & published interfaces may have several versions, backwards compatible or not)

- We have configured Teamcity to execute MsBuild scripts for build & release tasks.

- Code is stored in Subversion, where a branch (eg '1.x') represents the latest evolution of the service.

     --> trunk is used as reference and ReadOnly except for admins merging enhancements & creating branches.

     --> this is to support the different versions of the service interface & shared framework.

- The last number in the version of each assembly is the SVN revision, and will be used to identify the artifacts (and if possible also the build that created them)

In this context we need for each active branch of an application a :

- build configuration for Precommit verrification.  (building & unit testing)

- build configuration to create the versioned artifacts & package.  (versioning & building & testing & publishing & packaging & fxcop reports)

    --> triggered by a commit.

    --> the version number is created using a template in the solution, and the revision of the last commit.

- build configuration to deploy a given version to TST, UAT or PRD.

    --> I understand that this last one can be called via the Teamcity dashboard, using the [Run] [...] to enter the parameters.

Detailed question

In this context I was looking for the Deploy conf. to

- lookup the package (using the given versionnumber)

- copy / deploy it to the given target

- pin the build that created that package, so that I can clean up the packages & garbage from undeployed versions

OK we could make that a manual process: First Pin, then call the deploy.  But I just know this is going to be forgotten one day ;-)  and when the cleanup kicks in we've lost that deployed package :'(

--> but the TeamCity build has its own number.  Or can it also use the SVN revision to let a build Conf. identify itself with ?

--> and even if I can get to this number, how can I get the configuration or the msbuild script to pin that build...

thx,

Olivier

1 comment

Olivier,

Sorry for the delay with replying.

> but the TeamCity build has its own number.  Or can it also use the SVN revision to let a build Conf. identify itself with ?

To include VCS revision number into TeamCity buld number you can use %build.vcs.number.NNN% property in the build number format for the build configuration.

> and even if I can get to this number, how can I get the configuration or the msbuild script to pin that build...

There is no easy way to pin a build from outside, please watch/vote for the corresponding feature.

Right now this is possible via "undocumented" call like that performed on clicking PIN aciton in the browser. See comments to the doc page for detials.

Not sure I fully understand the specific need that you have but these hopefully answers your questions.

0

Please sign in to leave a comment.