Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

fixup: correct tags and publication for Windows images #374

Merged
merged 20 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
context: ./
dockerfile: ./windows/nanoserver/Dockerfile
args:
JAVA_MAJOR_VERSION: 11
version: ${PARENT_IMAGE_VERSION}
WINDOWS_VERSION_TAG: ${NANOSERVER_VERSION_TAG}
jdk17-nanoserver:
Expand All @@ -13,6 +14,7 @@ services:
context: ./
dockerfile: ./windows/nanoserver/Dockerfile
args:
JAVA_MAJOR_VERSION: 17
version: ${PARENT_IMAGE_VERSION}
WINDOWS_VERSION_TAG: ${NANOSERVER_VERSION_TAG}
jdk11-windowsservercore:
Expand All @@ -21,6 +23,7 @@ services:
context: ./
dockerfile: ./windows/windowsservercore/Dockerfile
args:
JAVA_MAJOR_VERSION: 11
version: ${PARENT_IMAGE_VERSION}
WINDOWS_VERSION_TAG: ${WINDOWS_VERSION_TAG}
jdk17-windowsservercore:
Expand All @@ -29,5 +32,6 @@ services:
context: ./
dockerfile: ./windows/windowsservercore/Dockerfile
args:
JAVA_MAJOR_VERSION: 17
version: ${PARENT_IMAGE_VERSION}
WINDOWS_VERSION_TAG: ${WINDOWS_VERSION_TAG}
18 changes: 9 additions & 9 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Param(
[Parameter(Position=1)]
[String] $Target = "build",
[String] $Build = '',
[String] $VersionTag = 'NEXT_TAG_VERSION',
[String] $ParentImageVersion = '3131.vf2b_b_798b_ce99-4',
[String] $BuildNumber = '1',
lemeurherve marked this conversation as resolved.
Show resolved Hide resolved
[switch] $PushVersions = $false
)

Expand Down Expand Up @@ -84,8 +84,8 @@ Invoke-Expression "$baseDockerCmd config --services" 2>$null | ForEach-Object {
$windowsVersion = $items[2]

$baseImage = "${windowsType}-${windowsVersion}"
$versionTag = "${ParentImageVersion}-${BuildNumber}-${image}"
$tags = @( $image, $versionTag )
$completeVersionTag = "${VersionTag}-${image}"
$tags = @( $image, $completeVersionTag )
if($jdkMajorVersion -eq "$defaultJdk") {
$tags += $baseImage
}
Expand Down Expand Up @@ -215,15 +215,15 @@ if($target -eq "publish") {
}

if($PushVersions) {
$buildTag = "$ParentImageVersion-$BuildNumber-$tag"
$buildTag = "$VersionTag-$tag"
if($tag -eq 'latest') {
$buildTag = "$ParentImageVersion-$BuildNumber"
$buildTag = "$VersionTag"
}
Publish-Image "$Build" "${Organization}/${Repository}:${buildTag}"
Publish-Image "$b" "${Organization}/${Repository}:${buildTag}"
if($lastExitCode -ne 0) {
$publishFailed = 1
}
}
}
}
} else {
foreach($b in $builds.Keys) {
Expand All @@ -234,9 +234,9 @@ if($target -eq "publish") {
}

if($PushVersions) {
$buildTag = "$ParentImageVersion-$BuildNumber-$tag"
$buildTag = "$VersionTag-$tag"
if($tag -eq 'latest') {
$buildTag = "$ParentImageVersion-$BuildNumber"
$buildTag = "$VersionTag"
}
Publish-Image "$b" "${Organization}/${Repository}:${buildTag}"
if($lastExitCode -ne 0) {
Expand Down