revisions plugin
Plugin provides extra properties to be used in build configuration i.e. for build number generation.
It provides properties:
-
build.revisions.<id>.revision - Value of revision, for Git it is SHA hash
-
build.revisions.<id>.short - Short hash for Git, otherwise N/A
Where <id> is id of your VCS defined in TeamCity.
Additionally for simplification there are properties
-
build.revisions.revision
-
build.revisions.short
Both refers to the first revision, if you have only one VCS root, it should be sufficient to use for you.
and install it to Teamcity following https://confluence.jetbrains.com/display/TCD10/Installing+Additional+Plugins