-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathBuild-All.ps1
42 lines (35 loc) · 1.12 KB
/
Build-All.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
param(
[Parameter(Mandatory)]
[ValidateSet('1809','2022','aws','windows-1809','windows-aws','windows-2022')]
[string]$tag
)
$ErrorActionPreference = 'Stop';
function Build-WebKitDockerImage {
param(
[Parameter(Mandatory)]
[string]$image,
[Parameter(Mandatory)]
[string]$tag
)
$path = Join-Path $PSScriptRoot $image;
if ($image -eq 'base') {
$file = Join-Path $path ('Dockerfile.{0}' -f $tag);
$buildArgs = '';
} else {
$file = Join-Path $path 'Dockerfile';
$buildArgs = ('--build-arg IMAGE_TAG={0}' -f $tag);
}
$cmd = 'docker build -t webkitdev/{0}:{1} {2} -f {3} -m 2GB {4}' -f $image,$tag,$buildArgs,$file,$path;
Write-Host ('Starting build at {0}' -f (Get-Date))
Write-Host $cmd;
Invoke-Expression $cmd;
if ($LASTEXITCODE -ne 0) {
Write-Error "docker build failed"
}
}
Build-WebKitDockerImage -Image base -Tag $tag;
Build-WebKitDockerImage -Image scripts -Tag $tag;
Build-WebKitDockerImage -Image scm -Tag $tag;
Build-WebKitDockerImage -Image tools -Tag $tag;
Build-WebKitDockerImage -Image msbuild-2022 -Tag $tag;
Build-WebKitDockerImage -Image buildbot-worker -Tag $tag;