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

fix: correct TEST_DEBUG retrieval in build.ps1 #422

Merged
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
21 changes: 9 additions & 12 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ $Repository = 'ssh-agent'
$Organisation = 'jenkins'
$ImageType = 'windows-ltsc2019'

$baseDockerCmd = 'docker-compose --file=build-windows.yaml'
$baseDockerBuildCmd = '{0} build --parallel --pull' -f $baseDockerCmd

if(![String]::IsNullOrWhiteSpace($env:TESTS_DEBUG)) {
$ImageType = $env:IMAGE_TYPE
$TestsDebug = $env:TESTS_DEBUG
}
$env:TESTS_DEBUG = $TestsDebug

Expand Down Expand Up @@ -84,10 +81,10 @@ function Test-Image {
$ImageNameAndJavaVersion
)

$items = $ImageNameAndJavaVersion.Split("|")
$items = $ImageNameAndJavaVersion.Split('|')
$imageName = $items[0]
$javaVersion = $items[1]
$imageNameItems = $imageName.Split(":")
$imageNameItems = $imageName.Split(':')
$imageTag = $imageNameItems[1]

Write-Host "= TEST: Testing ${ImageName} image"
Expand Down Expand Up @@ -119,15 +116,15 @@ function Test-Image {
$baseDockerCmd = 'docker-compose --file=build-windows.yaml'
$baseDockerBuildCmd = '{0} build --parallel --pull' -f $baseDockerCmd

Write-Host "= PREPARE: List of $Organisation/$env:DOCKERHUB_REPO images and tags to be processed:"
Write-Host "= PREPARE: List of images and tags to be processed:"
Invoke-Expression "$baseDockerCmd config"

Write-Host '= BUILD: Building all images...'
switch ($DryRun) {
$true { Write-Host "(dry-run) $baseDockerBuildCmd" }
$false { Invoke-Expression $baseDockerBuildCmd }
}
Write-Host '= BUILD: Finished building all images.'
switch ($DryRun) {
$true { Write-Host "(dry-run) $baseDockerBuildCmd" }
$false { Invoke-Expression $baseDockerBuildCmd }
}
Write-Host '= BUILD: Finished building all images.'

if($lastExitCode -ne 0) {
exit $lastExitCode
Expand Down