Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increment variable value in TFS build +1

I have a Microsoft Visual Studio Team Foundation Server (Version 15.117.26714.0) with predefined variable $(ProjectBuildNumber).

Is there any way to increment, during build process, value of variable with minor build number by +1?

$(ProjectBuildNumber)  =   663

So, that on next build it will be:

$(ProjectBuildNumber)  =   664

enter image description here

enter image description here

like image 552
Vasiliy Vegas Avatar asked May 14 '18 12:05

Vasiliy Vegas


1 Answers

In the variable section,

set the value of ProjectBuildNumber to $[counter('', 663)].

This will queue build starting with 663 as ProjectBuildNumber and increments by 1 for the subsequent queue of builds.

like image 178
Jabez Avatar answered Sep 28 '22 03:09

Jabez