kat1330
kat1330

Reputation: 5332

Select and Insert TFS build number into TFS database

I am trying to create custom build version number.

We already using some custom build template and have created custom activities. Now I am trying to add custom build version activity in our template.

My idea is to select last build and extract only number which represent number of builds. This is last digit and it can be e.g. 5.2.3.1032 (marked as bold). Based on last digit I will create next build number and insert into TFS database.

I can also use UpdateBuildNumber activity to insert number, but is there way to select build number by querying TFS db directly? It is also good if is possible via PowerShell.

Thanks

Upvotes: 2

Views: 112

Answers (1)

Giulio Vian
Giulio Vian

Reputation: 8353

It sounded familiar, in fact I wrote a post on this topic a while ago. Probably the code and details must be reviewed to work with recent TFS, but the general idea is still applicable.

At the core you use the IBuildServer.QueryBuilds method to read your build history and pick the information you need.

Upvotes: 1

Related Questions