Skip to content

Commit

Permalink
Update version script
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharparam committed Sep 5, 2015
1 parent 4cddaad commit 3f35a05
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions set_tc_version.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
$buildCounter = "%build.counter%"
$branch = "%teamcity.build.branch%"
$buildCounter = "$env:build_counter"
$branch = "$env:teamcity_build_branch"

$prefix = 'refs/heads/'
$tagPrefix = 'refs/tags/'
$isTag = False

$friendlyVersion = '0.0.0'
$buildNumber = "${friendlyVersion}.${buildCounter}"

if ($branch.StartsWith($prefix))
{
Expand All @@ -17,6 +18,7 @@ elseif ($branch.StartsWith($tagPrefix))
$isTag = True
}

Write-Host "Build counter: $buildCounter"
Write-Host "Branch: $branch"

if ($branch -eq 'master')
Expand All @@ -40,5 +42,5 @@ Write-Host "##teamcity[setParameter name='Version' value='$friendlyVersion']"

if (!$isTag)
{
Write-Host "##teamcity[setParameter name='InfoVersion' value='$friendlyVersion-$branch]"
Write-Host "##teamcity[setParameter name='InfoVersion' value='$friendlyVersion-$branch']"
}

2 comments on commit 3f35a05

@sharpblade-ci
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity Colore :: Release Build Build 69 is now running

@sharpblade-ci
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity Colore :: Release Build Build 0.0.0. outcome was SUCCESS
Summary: Tests passed: 111 Build time: 0:1:54

Please sign in to comment.