Skip to content

Commit 90ec963

Browse files
authored
Merge pull request #276 from datalust/ci/manifest
Create a docker manifest for CI builds
2 parents b865382 + 78ce028 commit 90ec963

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Build.Docker.ps1

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,21 @@ function Publish-DockerImage($arch)
5050
$ErrorActionPreference = "Stop"
5151
}
5252

53+
function Publish-DockerManifest($archs)
54+
{
55+
$images = ""
56+
foreach ($arch in $archs) {
57+
$images += "$image-ci:$version-$($arch.rid) "
58+
}
59+
60+
# We use `invoke-expression` here so each tag is treated as a separate arg
61+
invoke-expression "docker manifest create $image-ci:$version $images"
62+
if ($LASTEXITCODE) { exit 4 }
63+
64+
docker manifest push $image-ci:$version
65+
if ($LASTEXITCODE) { exit 4 }
66+
}
67+
5368
Push-Location $PSScriptRoot
5469

5570
Execute-Tests
@@ -62,4 +77,8 @@ foreach ($arch in $archs) {
6277
}
6378
}
6479

80+
if ($IsPublishedBuild) {
81+
Publish-DockerManifest($archs)
82+
}
83+
6584
Pop-Location

0 commit comments

Comments
 (0)