Skip to content

Commit

Permalink
Handle skipping docker build when PushImages is set and there is no d…
Browse files Browse the repository at this point in the history
…ockerfile (#16555)

Co-authored-by: Ben Broderick Phillips <[email protected]>
  • Loading branch information
2 people authored and mohsha-msft committed Jan 12, 2022
1 parent 0b36b2e commit d1141da
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,10 @@ function DeployStressPackage(
}
$imageTag += "/$($pkg.Namespace)/$($pkg.ReleaseName):${deployId}"

if ($pushImages) {
$dockerFilePath = "$($pkg.Directory)/Dockerfile"
if ($pushImages -and (Test-Path $dockerFilePath)) {
Write-Host "Building and pushing stress test docker image '$imageTag'"
$dockerFile = Get-ChildItem "$($pkg.Directory)/Dockerfile"
$dockerFile = Get-ChildItem $dockerFilePath
Run docker build -t $imageTag -f $dockerFile.FullName $dockerFile.DirectoryName
if ($LASTEXITCODE) { return }
Run docker push $imageTag
Expand Down

0 comments on commit d1141da

Please sign in to comment.