diff --git a/pipelines/build/common/openjdk_build_pipeline.groovy b/pipelines/build/common/openjdk_build_pipeline.groovy index cbcd63865..fa449d2ea 100644 --- a/pipelines/build/common/openjdk_build_pipeline.groovy +++ b/pipelines/build/common/openjdk_build_pipeline.groovy @@ -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() @@ -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) { @@ -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.