Use TeamCity to select commits

This commit is contained in:
Ryan Brandenburg 2017-10-25 16:42:38 -07:00
parent b2c73f13e2
commit 734df3f88f
1 changed files with 15 additions and 4 deletions

View File

@ -65,14 +65,25 @@ try {
}
}
Write-Verbose "git submodule update --remote"
Invoke-Block { & git submodule update --remote }
$changes = $submodules `
| % {
Push-Location $_.path
try {
$newCommit = $(git rev-parse HEAD)
$vcs_name = "BUILD_VCS_NUMBER_" + $_.module
$newCommit = [environment]::GetEnvironmentVariable($vcs_name)
if($newCommit -eq $null)
{
Write-Warning "TeamCity env variable '$vcs_name' not found."
Write-Warning "git submodule update --remote"
Invoke-Block { & git submodule update --remote }
$newCommit = $(git rev-parse HEAD)
}
else
{
Invoke-Block { & git checkout $newCommit }
}
$_.newCommit = $newCommit
if ($newCommit -ne $_.commit) {
$_.changed = $true