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 docker fixes/workarounds #1099

Merged
merged 4 commits into from
Aug 20, 2024
Merged
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
11 changes: 9 additions & 2 deletions pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,9 @@ class Build {

// Perform a git clean outside of checkout to avoid the Jenkins enforced 10 minute timeout
// https://github.com/adoptium/infrastucture/issues/1553
if ( buildConfig.TARGET_OS == 'windows' && buildConfig.DOCKER_IMAGE ) {
context.sh(script: 'git config --global safe.directory $(cygpath ' + '\$' + '{WORKSPACE})')
}
context.sh(script: 'git clean -fdx')

printGitRepoInfo()
Expand Down Expand Up @@ -2064,7 +2067,11 @@ class Build {
}
}
// Store the pulled docker image digest as 'buildinfo'
dockerImageDigest = context.sh(script: "docker inspect --format='{{.RepoDigests}}' ${buildConfig.DOCKER_IMAGE}", returnStdout:true)
if ( buildConfig.TARGET_OS == 'windows' && buildConfig.DOCKER_IMAGE ) {
dockerImageDigest = context.sh(script: "docker inspect --format={{.Id}} ${buildConfig.DOCKER_IMAGE} | /bin/cut -d: -f2", returnStdout:true)
} else {
dockerImageDigest = context.sh(script: "docker inspect --format='{{.RepoDigests}}' ${buildConfig.DOCKER_IMAGE}", returnStdout:true)
}

// Use our dockerfile if DOCKER_FILE is defined
if (buildConfig.DOCKER_FILE) {
Expand Down Expand Up @@ -2205,7 +2212,7 @@ class Build {
// Run Smoke Tests and AQA Tests
if (enableTests) {
if (currentBuild.currentResult != "SUCCESS") {
context.println("[ERROR] Build stages were not successful, not running AQA tests")
context.println('[ERROR] Build stages were not successful, not running AQA tests')
} else {
try {
//Only smoke tests succeed TCK and AQA tests will be triggerred.
Expand Down