Skip to content

Commit fa382bd

Browse files
Replace temurin with openjdk in Windows container and tweak docker build better support Windows (#3941)
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
1 parent 7b9c90b commit fa382bd

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

docker/ci/config/windows-servercore-setup.ps1

+4-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ $zlibRegFilePath
8181
regedit /s $zlibRegFilePath
8282

8383
# Install jdk
84-
$jdkVersionList = "temurin8-jdk JAVA8_HOME", "temurin11-jdk JAVA11_HOME", "temurin17-jdk JAVA17_HOME", "temurin19-jdk JAVA19_HOME", "openjdk20 JAVA20_HOME", "openjdk14 JAVA14_HOME"
84+
# Temurin jdk does not have all the versions supported on scoop, especially version 14, 20, and above
85+
# As of now we will switch everything to openjdk as it has the most complete lineup on scoop
86+
# This will also affect the distribution build jenkinsfile as it has dependencies on the names
87+
$jdkVersionList = "openjdk8 JAVA8_HOME", "openjdk11 JAVA11_HOME", "openjdk14 JAVA14_HOME", "openjdk17 JAVA17_HOME", "openjdk19 JAVA19_HOME", "openjdk20 JAVA20_HOME"
8588
Foreach ($jdkVersion in $jdkVersionList)
8689
{
8790
$jdkVersion
@@ -94,8 +97,6 @@ Foreach ($jdkVersion in $jdkVersionList)
9497
[System.Environment]::SetEnvironmentVariable($jdkArray[1], "$JAVA_HOME_TEMP", [System.EnvironmentVariableTarget]::User)
9598
java -version
9699
}
97-
# Need to reset to jdk11 for Jenkins Agent to start
98-
scoop reset temurin11-jdk
99100
$JAVA_HOME_TEMP = [System.Environment]::GetEnvironmentVariable("JAVA_HOME", [System.EnvironmentVariableTarget]::User).replace("\", "/")
100101
$JAVA_HOME_TEMP
101102
[System.Environment]::SetEnvironmentVariable('JAVA_HOME', "$JAVA_HOME_TEMP", [System.EnvironmentVariableTarget]::User)

jenkins/docker/docker-build.jenkinsfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pipeline {
6969
echo 'The docker-build workflow will only push docker images to staging, please use docker-copy to move the image to other repositories'
7070
checkout([$class: 'GitSCM', branches: [[name: "${DOCKER_BUILD_GIT_REPOSITORY_REFERENCE}" ]], userRemoteConfigs: [[url: "${DOCKER_BUILD_GIT_REPOSITORY}" ]]])
7171
def CREDENTIAL_ID = "jenkins-staging-dockerhub-credential"
72-
sh "echo Account: $CREDENTIAL_ID"
72+
sh("echo Account: ${CREDENTIAL_ID}")
7373
withCredentials([usernamePassword(credentialsId: CREDENTIAL_ID, usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) {
7474
sh '''
7575
set -e
@@ -83,7 +83,7 @@ pipeline {
8383
always {
8484
script {
8585
cleanWs disableDeferredWipeout: true, deleteDirs: true
86-
sh "docker logout && docker image prune -f --all"
86+
sh("docker logout && docker image prune -f --all")
8787
}
8888
}
8989
}

0 commit comments

Comments
 (0)