Created
May 1, 2017 16:03
-
-
Save renevanosnabrugge/c54f22f3ed77d800e9a5c7f5a8539e1b 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
function Invoke-CheckSameCommitInBuild | |
{ | |
$CurrentBuild = Get-BuildById -BuildId $currentBuildID | |
$builds = Get-BuildsByDefinition -BuildDefinitionID $CurrentBuild.definition[0].id | |
$LatestBuild = $builds.value | Where-Object {$_.result -eq "succeeded"} |Sort-Object {$_.finishtime} -Descending | select -First 1 | |
if ($LatestBuild -eq $null) | |
{ | |
#No successfull builds found, thus different commit" | |
Set-BuildTag -BuildID $currentBuildID -BuildTags "Release" | |
} | |
if ($LatestBuild.sourceVersion -ne $CurrentBuild.sourceVersion) | |
{ | |
# Not the same, tag with a Release Tag | |
Set-BuildTag -BuildID $currentBuildID -BuildTags "Release" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment