Skip to content

Commit 28e9c0f

Browse files
committed
Always get version from metadata
1 parent bb8b4aa commit 28e9c0f

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

build.ps1

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,24 +96,24 @@ if (!(Get-Command "docker" -ErrorAction SilentlyContinue))
9696
throw "'docker' command not found"
9797
}
9898

99+
if (Test-Path (Join-Path $ImageDirectory "metadata"))
100+
{
101+
$Version = Get-Content (Join-Path $ImageDirectory "metadata" "IMAGE_VERSION")
102+
}
103+
else
104+
{
105+
throw "No metadata found for $Name"
106+
}
107+
99108
if (!$Tag)
100109
{
101-
if (Test-Path (Join-Path $ImageDirectory "metadata"))
102-
{
103-
$Tag = "$DockerOrg/$Name"
104-
$Version = Get-Content (Join-Path $ImageDirectory "metadata" "IMAGE_VERSION")
105-
$Tag += ":$Version"
106-
$Revision = Get-Content (Join-Path $ImageDirectory "metadata" "IMAGE_REVISION")
107-
if ($Revision)
108-
{
109-
$Tag += "-$Revision"
110-
}
111-
$AdditionalTags = "$(Get-Content (Join-Path $ImageDirectory "metadata" "ADDITIONAL_TAGS") | ForEach-Object { $_.replace("$Name","$DockerOrg/$Name") })"
112-
}
113-
else
110+
$Tag = "$DockerOrg/${Name}:$Version"
111+
$Revision = Get-Content (Join-Path $ImageDirectory "metadata" "IMAGE_REVISION")
112+
if ($Revision)
114113
{
115-
throw "No metadata found for $Name"
114+
$Tag += "-$Revision"
116115
}
116+
$AdditionalTags = "$(Get-Content (Join-Path $ImageDirectory "metadata" "ADDITIONAL_TAGS") | ForEach-Object { $_.replace("$Name","$DockerOrg/$Name") })"
117117
}
118118
else
119119
{

0 commit comments

Comments
 (0)