Select Page

Display the short GIT version hash as build identifier in TeamCity

Display the short GIT version hash as build identifier in TeamCity

TeamCity is a Continuous integration and build management server from JetBrains.

As the first build step, create a custom script that reads %build.number%, and uses service messages to append the short GIT hash programmatically.

image

Here’s an example using a bash script pasted right into the TeamCity GUI (Runner type: Command Line, Run: Custom Script):

GIT_HASH=%build.vcs.number% GIT_HASH_SHORT=${GIT_HASH:0:7} echo "##teamcity[buildNumber '#${GIT_HASH_SHORT}']"
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments

Categories

0
Would love your thoughts, please comment.x
()
x