From d201bff229bcc555918b8d9fe406c05fa2612f2d Mon Sep 17 00:00:00 2001 From: Stewart X Addison Date: Wed, 6 Nov 2024 11:44:26 +0000 Subject: [PATCH] Move workspace scope and use it for cleaning cyclone-dx and security directories Signed-off-by: Stewart X Addison --- .../build/common/openjdk_build_pipeline.groovy | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pipelines/build/common/openjdk_build_pipeline.groovy b/pipelines/build/common/openjdk_build_pipeline.groovy index 976855976..60b7752aa 100644 --- a/pipelines/build/common/openjdk_build_pipeline.groovy +++ b/pipelines/build/common/openjdk_build_pipeline.groovy @@ -2137,6 +2137,10 @@ def buildScriptsAssemble( updateGithubCommitStatus('PENDING', 'Pending') } } + def workspace + if (buildConfig.TARGET_OS == 'windows') { + workspace = 'C:/workspace/openjdk-build/' + } if (buildConfig.DOCKER_IMAGE) { context.println "openjdk_build_pipeline: preparing to use docker image" // Docker build environment @@ -2159,7 +2163,10 @@ def buildScriptsAssemble( addNodeToBuildDescription() // Cannot clean workspace from inside docker container if ( buildConfig.TARGET_OS == 'windows' && buildConfig.DOCKER_IMAGE ) { - context.bat('rm -rf c:/workspace/openjdk-build/cyclonedx-lib c:/workspace/openjdk-build/security') + context.ws(workspace) { + context.bat("rm -rf " + context.WORKSPACE + "/cyclonedx-lib " + + context.WORKSPACE + "/security") + } } if (cleanWorkspace) { try { @@ -2257,7 +2264,6 @@ def buildScriptsAssemble( } if (buildConfig.TARGET_OS == 'windows') { context.println "openjdk_build_pipeline: running exploded build in docker on Windows" - def workspace = 'C:/workspace/openjdk-build/' context.echo("Switched to using non-default workspace path ${workspace}") context.println "openjdk_build_pipeline: building in windows docker image " + buildConfig.DOCKER_IMAGE context.ws(workspace) { @@ -2289,7 +2295,6 @@ def buildScriptsAssemble( if ( enableSigner && buildConfig.JAVA_TO_BUILD != 'jdk8u' ) { context.println "openjdk_build_pipeline: running eclipse signing phase" buildScriptsEclipseSigner() - def workspace = 'C:/workspace/openjdk-build/' context.ws(workspace) { context.println "Signing with non-default workspace location ${workspace}" context.println "openjdk_build_pipeline: running assemble phase (invocation 1)" @@ -2318,7 +2323,6 @@ def buildScriptsAssemble( context.echo("checking ${buildConfig.TARGET_OS}") if (buildConfig.TARGET_OS == 'windows') { // See https://github.com/adoptium/infrastucture/issues/1284#issuecomment-621909378 for justification of the below path - def workspace = 'C:/workspace/openjdk-build/' if (env.CYGWIN_WORKSPACE) { workspace = env.CYGWIN_WORKSPACE } @@ -2436,7 +2440,7 @@ def buildScriptsAssemble( } if ( !(buildConfig.JAVA_TO_BUILD == 'jdk8u' && platform == 's390x_linux') ) { context.echo "openjdk_build_pipeline: Remote trigger Eclipse Temurin AQA_Test_Pipeline job with ${platform} ${buildConfig.JAVA_TO_BUILD}" - def remoteTargets = remoteTriggerJckTests(platform, filename) + def remoteTargets = remoteTriggerJckTests(platform, filename) context.parallel remoteTargets } }