Skip to content

Commit

Permalink
wip parallel
Browse files Browse the repository at this point in the history
Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
  • Loading branch information
dduportal committed Oct 12, 2021
1 parent 20a5cf8 commit ca50764
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ $builds = @{}
$env:REMOTING_VERSION = "$RemotingVersion"
$ProgressPreference = 'SilentlyContinue' # Disable Progress bar for faster downloads

# Install docker-compose v2
# Ensures that docker-compose is present
# Docker-compose v2 does not works and prints a "not implemented" message (tested with 2.0.1)
$dockerComposeBin = "C:\tools\docker-compose.exe"
Invoke-WebRequest "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Windows-x86_64.exe" -OutFile "$dockerComposeBin"
if (-not(Test-Path -Path $dockerComposeBin)) {
Invoke-WebRequest "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Windows-x86_64.exe" -OutFile "$dockerComposeBin"
}
& "$dockerComposeBin" --version
& "$dockerComposeBin" --file=build-windows.yaml build --parallel --pull
Exit 1

Get-ChildItem -Recurse -Include windows -Directory | ForEach-Object {
Get-ChildItem -Directory -Path $_ | Where-Object { Test-Path (Join-Path $_.FullName "Dockerfile") } | ForEach-Object {
Expand All @@ -68,6 +69,9 @@ Get-ChildItem -Recurse -Include windows -Directory | ForEach-Object {
}
}

# Prebuild in parallel all images to populate the cache
& "$dockerComposeBin" --file=build-windows.yaml build --parallel --pull

if(![System.String]::IsNullOrWhiteSpace($Build) -and $builds.ContainsKey($Build)) {
foreach($tag in $builds[$Build]['Tags']) {
Write-Host "Building $Build => tag=$tag"
Expand All @@ -85,8 +89,6 @@ if(![System.String]::IsNullOrWhiteSpace($Build) -and $builds.ContainsKey($Build)
}
}
} else {
# Prebuild in parallel all images to populate the cache

foreach($b in $builds.Keys) {
foreach($tag in $builds[$b]['Tags']) {
Write-Host "Building $b => tag=$tag"
Expand Down

0 comments on commit ca50764

Please sign in to comment.