gradle-git-properties icon indicating copy to clipboard operation
gradle-git-properties copied to clipboard

HEAD instead of branch name in TeamCity

Open guai opened this issue 2 years ago • 0 comments

The code in BranchProperty class for branch detection in Teamcity won't work:

'TEAMCITY_VERSION' : ['teamcity.build.branch'], // https://confluence.jetbrains.com/display/TCD9/Predefined+Build+Parameters

teamcity does not set the branch name to any env by default. It have a teamcity.build.branch parameter though, which can be passed into the gradle explicitly. With something like -Dteamcity.build.branch=%teamcity.build.branch% And then read via System.getProperty("teamcity.build.branch")

guai avatar Jan 31 '23 10:01 guai