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 (Azure#22107)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
  • Loading branch information
azure-sdk and benbp authored Jan 6, 2022
1 parent 0a54295 commit f7bcfd7
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 f7bcfd7

Please sign in to comment.