Skip to content

Instantly share code, notes, and snippets.

@jmaxxz
Created January 17, 2020 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmaxxz/b3fe1c4c6fa1a6b79cf043e6a93e6569 to your computer and use it in GitHub Desktop.
Save jmaxxz/b3fe1c4c6fa1a6b79cf043e6a93e6569 to your computer and use it in GitHub Desktop.
param([string]$buildCounter, [string]$branchName, [string]$defaultPrefix)
Write-Host "Getting build number from branch"
$versionPrefix=$defaultPrefix
$matches = [regex]::Match($branchName, "release-v(?<version>\d+\.\d+)\.x")
if ($matches.success)
{
$versionPrefix = $matches.groups["version"].value
}
$buildNumber = "$versionPrefix.$buildCounter"
Write-Host "##teamcity[buildNumber '${buildNumber}']"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment