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

Commit

Permalink
feat!: set Java 17 as default (#419)
Browse files Browse the repository at this point in the history
  • Loading branch information
lemeurherve authored Oct 12, 2023
1 parent e85e6f8 commit be3e315
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ check_image = make --silent list | grep -w '$(1)' >/dev/null 2>&1 || { echo "Err
## Base "docker buildx base" command to be reused everywhere
bake_base_cli := docker buildx bake -f docker-bake.hcl --load

.PHONY: build test test-alpine test-debian test-jdk11 test-jdk11-alpine
.PHONY: build test test-alpine test-debian test-jdk17 test-jdk17-alpine

check-reqs:
## Build requirements
Expand Down
8 changes: 4 additions & 4 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ Function Test-CommandExists {
}
}

# # this is the jdk version that will be used for the 'bare tag' images, e.g., jdk8-windowsservercore-1809 -> windowsserver-1809
$defaultJdk = '11'
# # this is the jdk version that will be used for the 'bare tag' images, e.g., jdk7-windowsservercore-1809 -> windowsserver-1809
$defaultJdk = '17'
$builds = @{}
$env:PARENT_IMAGE_VERSION = "$ParentImageVersion"

Expand All @@ -75,7 +75,7 @@ $baseDockerCmd = 'docker-compose --file=build-windows.yaml'
$baseDockerBuildCmd = '{0} build --parallel --pull' -f $baseDockerCmd

Invoke-Expression "$baseDockerCmd config --services" 2>$null | ForEach-Object {
$image = '{0}-{1}-{2}' -f $_, $env:WINDOWS_FLAVOR, $env:WINDOWS_VERSION_TAG # Ex: "jdk11-windowsservercore-ltsc2019"
$image = '{0}-{1}-{2}' -f $_, $env:WINDOWS_FLAVOR, $env:WINDOWS_VERSION_TAG # Ex: "jdk17-windowsservercore-ltsc2019"

# Remove the 'jdk' prefix (3 first characters)
$jdkMajorVersion = $_.Remove(0,3)
Expand Down Expand Up @@ -116,7 +116,7 @@ function Test-Image {
$ImageName
)

Write-Host "= TEST: Testing image ${ImageName}:" # Ex: jdk11-windowsservercore-ltsc2019
Write-Host "= TEST: Testing image ${ImageName}:" # Ex: jdk17-windowsservercore-ltsc2019

$env:AGENT_IMAGE = $ImageName
$serviceName = $ImageName.SubString(0, $ImageName.IndexOf('-'))
Expand Down
10 changes: 5 additions & 5 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,8 @@ target "alpine_jdk11" {
version = "${PARENT_IMAGE_VERSION}"
}
tags = [
equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${PARENT_IMAGE_VERSION}-alpine" : "",
equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${PARENT_IMAGE_VERSION}-alpine-jdk11" : "",
"${REGISTRY}/${JENKINS_REPO}:alpine",
"${REGISTRY}/${JENKINS_REPO}:alpine-jdk11",
"${REGISTRY}/${JENKINS_REPO}:latest-alpine",
"${REGISTRY}/${JENKINS_REPO}:latest-alpine-jdk11",
]
platforms = ["linux/amd64"]
Expand All @@ -78,8 +75,11 @@ target "alpine_jdk17" {
version = "${PARENT_IMAGE_VERSION}"
}
tags = [
equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${PARENT_IMAGE_VERSION}-alpine" : "",
equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${PARENT_IMAGE_VERSION}-alpine-jdk17" : "",
"${REGISTRY}/${JENKINS_REPO}:alpine",
"${REGISTRY}/${JENKINS_REPO}:alpine-jdk17",
"${REGISTRY}/${JENKINS_REPO}:latest-alpine",
"${REGISTRY}/${JENKINS_REPO}:latest-alpine-jdk17",
]
platforms = ["linux/amd64"]
Expand Down Expand Up @@ -108,10 +108,8 @@ target "debian_jdk11" {
version = "${PARENT_IMAGE_VERSION}"
}
tags = [
equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${PARENT_IMAGE_VERSION}" : "",
equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${PARENT_IMAGE_VERSION}-jdk11" : "",
"${REGISTRY}/${JENKINS_REPO}:jdk11",
"${REGISTRY}/${JENKINS_REPO}:latest",
"${REGISTRY}/${JENKINS_REPO}:latest-jdk11",
]
platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7", "linux/s390x", "linux/ppc64le"]
Expand All @@ -125,8 +123,10 @@ target "debian_jdk17" {
version = "${PARENT_IMAGE_VERSION}"
}
tags = [
equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${PARENT_IMAGE_VERSION}" : "",
equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${PARENT_IMAGE_VERSION}-jdk17" : "",
"${REGISTRY}/${JENKINS_REPO}:jdk17",
"${REGISTRY}/${JENKINS_REPO}:latest",
"${REGISTRY}/${JENKINS_REPO}:latest-jdk17",
]
platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7", "linux/ppc64le"]
Expand Down
2 changes: 1 addition & 1 deletion tests/inboundAgent.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Describe "[$global:AGENT_IMAGE] custom build args" {
BeforeAll {
Push-Location -StackName 'agent' -Path "$PSScriptRoot/.."
# Old version used to test overriding the build arguments.
# This old version must have the same tag suffixes as the current windows images (`-jdk11-nanoserver` etc.), and the same Windows version (2019, 2022, etc.)
# This old version must have the same tag suffixes as the current windows images (`-jdk17-nanoserver` etc.), and the same Windows version (2019, 2022, etc.)
$TEST_VERSION = "3148.v532a_7e715ee3"
$PARENT_IMAGE_VERSION_SUFFIX = "12"
$ARG_TEST_VERSION = "${TEST_VERSION}-${PARENT_IMAGE_VERSION_SUFFIX}"
Expand Down

0 comments on commit be3e315

Please sign in to comment.