Created
August 11, 2014 01:12
-
-
Save mbenford/e306ff83ff0a70799e14 to your computer and use it in GitHub Desktop.
Powershell script for TeamCity that sets some parameters to be used with Octopus Deploy based on the current branch
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
function Is-Default-Branch { | |
return "%teamcity.build.branch.is_default%" -eq "true" | |
} | |
function Set-TeamCity-Parameter($name, $value) { | |
Write-Host "##teamcity[setParameter name='$name' value='$value']" | |
} | |
if (Is-Default-Branch) { | |
$releaseNumber = "%octopus.master.releaseNumber%" | |
$deployTo = "%octopus.master.deployTo%" | |
$packageVersion = "%octopus.master.packageVersion%" | |
} | |
else { | |
$releaseNumber = "%octopus.release.releaseNumber%" | |
$deployTo = "%octopus.release.deployTo%" | |
$packageVersion = "%octopus.release.packageVersion%" | |
} | |
Set-TeamCity-Parameter "octopus.releaseNumber" $releaseNumber | |
Set-TeamCity-Parameter "octopus.packageVersion" $packageVersion | |
Set-TeamCity-Parameter "octopus.deployTo" $deployTo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment