Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows Container] Replace temurin with openjdk in Windows container and tweak docker build better support Windows #3941

Merged
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
7 changes: 4 additions & 3 deletions docker/ci/config/windows-servercore-setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ $zlibRegFilePath
regedit /s $zlibRegFilePath

# Install jdk
$jdkVersionList = "temurin8-jdk JAVA8_HOME", "temurin11-jdk JAVA11_HOME", "temurin17-jdk JAVA17_HOME", "temurin19-jdk JAVA19_HOME", "openjdk20 JAVA20_HOME", "openjdk14 JAVA14_HOME"
# Temurin jdk does not have all the versions supported on scoop, especially version 14, 20, and above
# As of now we will switch everything to openjdk as it has the most complete lineup on scoop
# This will also affect the distribution build jenkinsfile as it has dependencies on the names
$jdkVersionList = "openjdk8 JAVA8_HOME", "openjdk11 JAVA11_HOME", "openjdk14 JAVA14_HOME", "openjdk17 JAVA17_HOME", "openjdk19 JAVA19_HOME", "openjdk20 JAVA20_HOME"
Foreach ($jdkVersion in $jdkVersionList)
{
$jdkVersion
Expand All @@ -94,8 +97,6 @@ Foreach ($jdkVersion in $jdkVersionList)
[System.Environment]::SetEnvironmentVariable($jdkArray[1], "$JAVA_HOME_TEMP", [System.EnvironmentVariableTarget]::User)
java -version
}
# Need to reset to jdk11 for Jenkins Agent to start
scoop reset temurin11-jdk
$JAVA_HOME_TEMP = [System.Environment]::GetEnvironmentVariable("JAVA_HOME", [System.EnvironmentVariableTarget]::User).replace("\", "/")
$JAVA_HOME_TEMP
[System.Environment]::SetEnvironmentVariable('JAVA_HOME', "$JAVA_HOME_TEMP", [System.EnvironmentVariableTarget]::User)
Expand Down
4 changes: 2 additions & 2 deletions jenkins/docker/docker-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pipeline {
echo 'The docker-build workflow will only push docker images to staging, please use docker-copy to move the image to other repositories'
checkout([$class: 'GitSCM', branches: [[name: "${DOCKER_BUILD_GIT_REPOSITORY_REFERENCE}" ]], userRemoteConfigs: [[url: "${DOCKER_BUILD_GIT_REPOSITORY}" ]]])
def CREDENTIAL_ID = "jenkins-staging-dockerhub-credential"
sh "echo Account: $CREDENTIAL_ID"
sh("echo Account: ${CREDENTIAL_ID}")
withCredentials([usernamePassword(credentialsId: CREDENTIAL_ID, usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) {
sh '''
set -e
Expand All @@ -83,7 +83,7 @@ pipeline {
always {
script {
cleanWs disableDeferredWipeout: true, deleteDirs: true
sh "docker logout && docker image prune -f --all"
sh("docker logout && docker image prune -f --all")
}
}
}
Expand Down