diff --git a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 index 1d8d958a2cd0..25af8c9edd72 100644 --- a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 +++ b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 @@ -116,10 +116,15 @@ function DeployStressPackage( exit 1 } - if ($pushImages) { - Run helm dependency update $pkg.Directory - if ($LASTEXITCODE) { return $LASTEXITCODE } + Run helm dependency update $pkg.Directory + if ($LASTEXITCODE) { return } + + if (Test-Path "$($pkg.Directory)/test-resources.bicep") { + Run az bicep build -f "$($pkg.Directory)/test-resources.bicep" + if ($LASTEXITCODE) { return } + } + if ($pushImages) { $dockerFiles = Get-ChildItem "$($pkg.Directory)/Dockerfile*" foreach ($dockerFile in $dockerFiles) { # Infer docker image name from parent directory name, if file is named `Dockerfile` @@ -131,13 +136,13 @@ function DeployStressPackage( $imageTag = "${registry}.azurecr.io/$($repository.ToLower())/$($imageName):$deployId" Write-Host "Building and pushing stress test docker image '$imageTag'" Run docker build -t $imageTag -f $dockerFile.FullName $dockerFile.DirectoryName - if ($LASTEXITCODE) { return $LASTEXITCODE } + if ($LASTEXITCODE) { return } Run docker push $imageTag if ($LASTEXITCODE) { if ($PSCmdlet.ParameterSetName -ne 'DoLogin') { Write-Warning "If docker push is failing due to authentication issues, try calling this script with '-Login'" } - return $LASTEXITCODE + return } } } @@ -157,7 +162,7 @@ function DeployStressPackage( # can be the result of cancelled `upgrade` operations (e.g. ctrl-c). # See https://github.com/helm/helm/issues/4558 Write-Warning "The issue may be fixable by first running 'helm rollback -n $($pkg.Namespace) $($pkg.ReleaseName)'" - return $LASTEXITCODE + return } # Helm 3 stores release information in kubernetes secrets. The only way to add extra labels around