Skip to content

Commit

Permalink
Move workspace scope and use it for cleaning cyclone-dx and security …
Browse files Browse the repository at this point in the history
…directories

Signed-off-by: Stewart X Addison <[email protected]>
  • Loading branch information
sxa committed Nov 6, 2024
1 parent 179ff40 commit d201bff
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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)"
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
}
Expand Down

0 comments on commit d201bff

Please sign in to comment.