Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync eng/common directory with azure-sdk-tools for PR 1866 #15261

Merged
merged 2 commits into from
Aug 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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