Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools for PR 1188 (Azure#17488)
Browse files Browse the repository at this point in the history
* Add debug flag to arm deployment command

* Only set debug preference when $CI is true

Co-authored-by: Ben Broderick Phillips <[email protected]>
  • Loading branch information
azure-sdk and benbp authored Nov 11, 2020
1 parent 2a4eefe commit 530ddf1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions eng/common/TestResources/New-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ if ($CI) {
if ($EnvironmentVariables.ContainsKey('AZURE_RESOURCEGROUP_NAME') -and `
$EnvironmentVariables['AZURE_RESOURCEGROUP_NAME'] -ne $ResourceGroupName)
{
Write-Warning ("Overwriting 'EnvironmentVariables.AZURE_RESOURCEGROUP_NAME' with value " +
Write-Warning ("Overwriting 'EnvironmentVariables.AZURE_RESOURCEGROUP_NAME' with value " +
"'$($EnvironmentVariables['AZURE_RESOURCEGROUP_NAME'])' " + "to new value '$($ResourceGroupName)'")
}
$EnvironmentVariables['AZURE_RESOURCEGROUP_NAME'] = $ResourceGroupName
Expand Down Expand Up @@ -385,7 +385,15 @@ foreach ($templateFile in $templateFiles) {

Log "Deploying template '$templateFile' to resource group '$($resourceGroup.ResourceGroupName)'"
$deployment = Retry {
New-AzResourceGroupDeployment -Name $BaseName -ResourceGroupName $resourceGroup.ResourceGroupName -TemplateFile $templateFile -TemplateParameterObject $templateFileParameters
$lastDebugPreference = $DebugPreference
try {
if ($CI) {
$DebugPreference = "Continue"
}
New-AzResourceGroupDeployment -Name $BaseName -ResourceGroupName $resourceGroup.ResourceGroupName -TemplateFile $templateFile -TemplateParameterObject $templateFileParameters
} finally {
$DebugPreference = $lastDebugPreference
}
}

if ($deployment.ProvisioningState -eq 'Succeeded') {
Expand Down

0 comments on commit 530ddf1

Please sign in to comment.