Skip to content

Commit 9c0c071

Browse files
azure-sdkbenbp
andauthored
Sync eng/common directory with azure-sdk-tools for PR 1866 (Azure#20219)
* Deploy for stress tests at resource group scope * Automatically compile bicep files in stress test deploy script Co-authored-by: Ben Broderick Phillips <[email protected]>
1 parent 10c5169 commit 9c0c071

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

eng/common/scripts/stress-testing/deploy-stress-tests.ps1

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,15 @@ function DeployStressPackage(
116116
exit 1
117117
}
118118

119-
if ($pushImages) {
120-
Run helm dependency update $pkg.Directory
121-
if ($LASTEXITCODE) { return $LASTEXITCODE }
119+
Run helm dependency update $pkg.Directory
120+
if ($LASTEXITCODE) { return }
121+
122+
if (Test-Path "$($pkg.Directory)/test-resources.bicep") {
123+
Run az bicep build -f "$($pkg.Directory)/test-resources.bicep"
124+
if ($LASTEXITCODE) { return }
125+
}
122126

127+
if ($pushImages) {
123128
$dockerFiles = Get-ChildItem "$($pkg.Directory)/Dockerfile*"
124129
foreach ($dockerFile in $dockerFiles) {
125130
# Infer docker image name from parent directory name, if file is named `Dockerfile`
@@ -131,13 +136,13 @@ function DeployStressPackage(
131136
$imageTag = "${registry}.azurecr.io/$($repository.ToLower())/$($imageName):$deployId"
132137
Write-Host "Building and pushing stress test docker image '$imageTag'"
133138
Run docker build -t $imageTag -f $dockerFile.FullName $dockerFile.DirectoryName
134-
if ($LASTEXITCODE) { return $LASTEXITCODE }
139+
if ($LASTEXITCODE) { return }
135140
Run docker push $imageTag
136141
if ($LASTEXITCODE) {
137142
if ($PSCmdlet.ParameterSetName -ne 'DoLogin') {
138143
Write-Warning "If docker push is failing due to authentication issues, try calling this script with '-Login'"
139144
}
140-
return $LASTEXITCODE
145+
return
141146
}
142147
}
143148
}
@@ -157,7 +162,7 @@ function DeployStressPackage(
157162
# can be the result of cancelled `upgrade` operations (e.g. ctrl-c).
158163
# See https://github.com/helm/helm/issues/4558
159164
Write-Warning "The issue may be fixable by first running 'helm rollback -n $($pkg.Namespace) $($pkg.ReleaseName)'"
160-
return $LASTEXITCODE
165+
return
161166
}
162167

163168
# Helm 3 stores release information in kubernetes secrets. The only way to add extra labels around

0 commit comments

Comments
 (0)