Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class StressTestPackageInfo {
[string]$Namespace
[string]$Directory
[string]$ReleaseName
[string]$Dockerfile
[string]$DockerBuildDir
}

function FindStressPackages([string]$directory, [hashtable]$filters = @{}, [switch]$CI) {
Expand Down Expand Up @@ -52,6 +54,8 @@ function NewStressTestPackageInfo([hashtable]$chart, [System.IO.FileInfo]$chartF
Namespace = $namespace.ToLower()
Directory = $chartFile.DirectoryName
ReleaseName = $chart.name
Dockerfile = $chart.annotations.dockerfile
DockerBuildDir = $chart.annotations.dockerbuilddir
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,24 @@ function DeployStressPackage(
}
$imageTag += "/$($pkg.Namespace)/$($pkg.ReleaseName):${deployId}"

$dockerFilePath = "$($pkg.Directory)/Dockerfile"
$dockerFilePath = if ($pkg.Dockerfile) {
Join-Path $pkg.Directory $pkg.Dockerfile
} else {
"$($pkg.Directory)/Dockerfile"
}
$dockerFilePath = [System.IO.Path]::GetFullPath($dockerFilePath)

if ($pushImages -and (Test-Path $dockerFilePath)) {
Write-Host "Building and pushing stress test docker image '$imageTag'"
$dockerFile = Get-ChildItem $dockerFilePath
Run docker build -t $imageTag -f $dockerFile.FullName $dockerFile.DirectoryName
$dockerBuildFolder = if ($pkg.DockerBuildDir) {
Join-Path $pkg.Directory $pkg.DockerBuildDir
} else {
$dockerFile.DirectoryName
}
$dockerBuildFolder = [System.IO.Path]::GetFullPath($dockerBuildFolder).Trim()

Run docker build -t $imageTag -f $dockerFile $dockerBuildFolder
if ($LASTEXITCODE) { return }
Run docker push $imageTag
if ($LASTEXITCODE) {
Expand Down