Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools for PR 1866 (#16847)
Browse files Browse the repository at this point in the history
* Deploy for stress tests at resource group scope

* Automatically compile bicep files in stress test deploy script

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
  • Loading branch information
azure-sdk and benbp authored Aug 11, 2021
1 parent 8803a0d commit 2f0fffd
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions eng/common/scripts/stress-testing/deploy-stress-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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
}
}
}
Expand All @@ -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
Expand Down

0 comments on commit 2f0fffd

Please sign in to comment.