Skip to content

Commit

Permalink
small build.ps1 improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
lemeurherve committed Jun 9, 2024
1 parent 231fc6f commit 5b36738
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $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 +84,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 +119,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

0 comments on commit 5b36738

Please sign in to comment.