From 734df3f88f72d56f89d15ccb97a527c95534fc11 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Wed, 25 Oct 2017 16:42:38 -0700 Subject: [PATCH] Use TeamCity to select commits --- scripts/UpdateSubmodules.ps1 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/UpdateSubmodules.ps1 b/scripts/UpdateSubmodules.ps1 index 0695f198a0..eb78545934 100755 --- a/scripts/UpdateSubmodules.ps1 +++ b/scripts/UpdateSubmodules.ps1 @@ -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