Skip to content

Commit

Permalink
Fix version script
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharparam committed Sep 6, 2015
1 parent 3f35a05 commit 72084e5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
Binary file modified Corale.Colore/Properties/AssemblyInfo.cs
Binary file not shown.
29 changes: 22 additions & 7 deletions set_tc_version.ps1 → set_version.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
$buildCounter = "$env:build_counter"
$branch = "$env:teamcity_build_branch"
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True, Position=1)]
[int]$buildCounter,

[Parameter(Mandatory=$True, Position=2)]
[string]$branch
)

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

$friendlyVersion = '0.0.0'
$buildNumber = "${friendlyVersion}.${buildCounter}"
Expand All @@ -15,7 +21,7 @@ if ($branch.StartsWith($prefix))
elseif ($branch.StartsWith($tagPrefix))
{
$branch = $branch.substring($tagPrefix.length)
$isTag = True
$isTag = $True
}

Write-Host "Build counter: $buildCounter"
Expand All @@ -37,10 +43,19 @@ elseif ($branch -match "^v\d+\.\d+\.\d+$")
$buildNumber = "${friendlyVersion}.${buildCounter}"
}

Write-Host "##teamcity[buildNumber '$buildNumber']"
Write-Host "##teamcity[setParameter name='Version' value='$friendlyVersion']"
$infoVersion = $friendlyVersion

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

Write-Host "##teamcity[buildNumber '$buildNumber']"
Write-Host "##teamcity[setParameter name='Version' value='$friendlyVersion']"
Write-Host "##teamcity[setParameter name='InfoVersion' value='$infoVersion']"

(Get-Content Corale.Colore/Properties/AssemblyInfo.cs) `
-replace '^\[assembly: AssemblyVersion.+$', "[assembly: AssemblyVersion(`"$friendlyVersion`")]" `
-replace '^\[assembly: AssemblyFileVersion.+$', "[assembly: AssemblyFileVersion(`"$buildNumber`")]" `
-replace '^\[assembly: AssemblyInformationalVersion.+$', "[assembly: AssemblyInformationalVersion(`"$infoVersion`")]" |
Out-File Corale.Colore/Properties/AssemblyInfo.cs

10 comments on commit 72084e5

@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 70 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 70 outcome was FAILURE
Summary: Skipping master branch Build time: 0:0:11

@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 71 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 71 outcome was SUCCESS
Summary: Skipping master branch Build time: 0:0:3

@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 72 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 72 outcome was FAILURE
Summary: Exit code -196608 (new) Build time: 0:0:3

@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 73 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 2.0.3.73 outcome was SUCCESS
Summary: Tests passed: 111 Build time: 0:3:27

@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 :: Main Build Build 66 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 :: Main Build Build 66 outcome was SUCCESS
Summary: Tests passed: 111 Build time: 0:0:52

Please sign in to comment.