From adf599e7c2031dda7f972e9a7a6876fa4b265b3e Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Thu, 2 Nov 2017 10:18:32 -0700 Subject: [PATCH] Fail the submodule script if the VCS roots are not configured to match submodules --- scripts/UpdateSubmodules.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/UpdateSubmodules.ps1 b/scripts/UpdateSubmodules.ps1 index 530f1903db..5b9dd8ded5 100755 --- a/scripts/UpdateSubmodules.ps1 +++ b/scripts/UpdateSubmodules.ps1 @@ -58,11 +58,13 @@ try { $submodulePath = $submodule.path Write-Host "Updating $submodulePath" - $vcs_name = "BUILD_VCS_NUMBER_" + $submodule.module + $vcs_name = "BUILD_VCS_NUMBER_" + ($submodule.module -replace '.','_') $newCommit = [environment]::GetEnvironmentVariable($vcs_name) if (-not $newCommit) { - Write-Warning "TeamCity env variable '$vcs_name' not found. Pulling the latest submodule branch instead" + if ($env:TEAMCITY_PROJECT_NAME) { + throw "TeamCity env variable '$vcs_name' not found. Make sure to configure a VCS root for $submodulePath" + } Invoke-Block { & git submodule update --remote $submodulePath } Push-Location $submodulePath | Out-Null try {