1

I'm trying to use Git tags as build numbers within TeamCity

For example if i'll push "11" as a tag to git branch, build number must be 11 too. I've seen examples using branch name as build number but couldn't find using tag as build number.

Is there anyway to do this?

Ahmet Kakıcı
  • 6,294
  • 4
  • 37
  • 49

1 Answers1

0

You can do this using a minor custom script (i.e shell script or the equivalent windows script). Before you start the build read that tag that teamcity is checking out and update the build number of the run.

For reading the tag , you can use either logical branch name if your targets scan multiple tags or the checkout branch name if your target scans only one tag name

http://confluence.jetbrains.com/display/TCD8/Working+with+Feature+Branches#WorkingwithFeatureBranches-Logicalbranchname

For updating build number from within a target , you can check this link http://confluence.jetbrains.com/display/TCD8/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ReportingBuildNumber

Biswajit_86
  • 3,661
  • 2
  • 22
  • 36