Skip to content

Commit f046d7c

Browse files
azure-sdkbenbp
authored andcommitted
Handle skipping docker build when PushImages is set and there is no dockerfile (Azure#22107)
Co-authored-by: Ben Broderick Phillips <[email protected]>
1 parent f572290 commit f046d7c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1

+3-2
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,10 @@ function DeployStressPackage(
156156
}
157157
$imageTag += "/$($pkg.Namespace)/$($pkg.ReleaseName):${deployId}"
158158

159-
if ($pushImages) {
159+
$dockerFilePath = "$($pkg.Directory)/Dockerfile"
160+
if ($pushImages -and (Test-Path $dockerFilePath)) {
160161
Write-Host "Building and pushing stress test docker image '$imageTag'"
161-
$dockerFile = Get-ChildItem "$($pkg.Directory)/Dockerfile"
162+
$dockerFile = Get-ChildItem $dockerFilePath
162163
Run docker build -t $imageTag -f $dockerFile.FullName $dockerFile.DirectoryName
163164
if ($LASTEXITCODE) { return }
164165
Run docker push $imageTag

0 commit comments

Comments
 (0)