Created
January 17, 2020 15:04
-
-
Save jmaxxz/b3fe1c4c6fa1a6b79cf043e6a93e6569 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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