Fail the submodule script if the VCS roots are not configured to match submodules

This commit is contained in:
Nate McMaster 2017-11-02 10:18:32 -07:00
parent 60faa8db90
commit adf599e7c2
1 changed files with 4 additions and 2 deletions

View File

@ -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 {