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

Ensure any old openjdk build directory is removed before building #1030

Merged
merged 2 commits into from
May 15, 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
18 changes: 18 additions & 0 deletions pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -1533,6 +1533,24 @@ class Build {
}
}

// Always clean any previous "openjdk_build_dir" output, possibly from any previous aborted build..
try {
try {
context.timeout(time: buildTimeouts.NODE_CLEAN_TIMEOUT, unit: 'HOURS') {
if (context.WORKSPACE != null && !context.WORKSPACE.isEmpty()) {
context.println 'Removing workspace openjdk build directory: ' + openjdk_build_dir
context.sh(script: 'rm -rf ' + openjdk_build_dir)
} else {
context.println 'Warning: Unable to remove workspace openjdk build directory as context.WORKSPACE is null/empty'
}
}
} catch (FlowInterruptedException e) {
throw new Exception("[ERROR] Remove workspace openjdk build directory timeout (${buildTimeouts.NODE_CLEAN_TIMEOUT} HOURS) has been reached. Exiting...")
}
} catch (e) {
context.println "[WARNING] Failed to remove workspace openjdk build directory: ${e}"
}

try {
context.timeout(time: buildTimeouts.NODE_CHECKOUT_TIMEOUT, unit: 'HOURS') {
if (useAdoptShellScripts) {
Expand Down