-
-
Notifications
You must be signed in to change notification settings - Fork 249
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
Add cleanWorkspaceAfterBuild and cleanWorkspaceBuildOutputAfterBuild #2416
Conversation
f8b6893
to
6b15fe6
Compare
I believe this pr addresses #2296 |
a1bceee
to
55e068d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't like that find construct ... If this is likely to only affect one file can we just handle it explicitly or perhaps find . -type f -name \*..\*
? Also I'd recommend removing the verbosity here - maybe just keep the rm
lines instead of the bit printing them all out?
It's any file that has ".." in it, the 2 i've discovered so far:
|
Yeah, I thought the print was useful debug for the moment, but i'll remove |
Yes, I like the -type f, good idea |
@sxa The other solution is not use CleanWs, just use rm -rf on the specific folders? |
i'm thinking that's probably the best option - keeps it simple, but if we do that let's add a comment pointing to the issue as an explanation of why we're not using |
7c60e39
to
e0242a8
Compare
5f5cb31
to
29714a6
Compare
run tests |
🟠 PR TESTER RESULT 🟠❎ Some pipelines failed or the job was aborted! ❎ |
run tests |
🟠 PR TESTER RESULT 🟠❎ Some pipelines failed or the job was aborted! ❎ |
run tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good now but I won't formally approve til I have another look over it in the morning (unless two other people want to approve in the meantime!)
Would be good to check a few random machines to see how much space workspace/build-scripts
is taking and compare it to the same numbers a week after merging this when it should have taken effect across most of the machines. Should particularly help the scaleway arm32 build systems
Clicked wrong button - as per previous comment not doing full approval til tomorrow :-)
🟢 PR TESTER RESULT 🟢✅ All pipelines passed! ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the naming which I think it's now confusing I think this is ready
Signed-off-by: Andrew Leonard <[email protected]>
29714a6
to
50bf26e
Compare
run tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep I'll take that - thanks. Clear enough now I reckon :-)
ping @karianna as you are currently blocking this |
🟠 PR TESTER RESULT 🟠❎ Some pipelines failed or the job was aborted! ❎ |
run tests |
🟢 PR TESTER RESULT 🟢✅ All pipelines passed! ✅ |
context.cleanWs notFailBuild: true, disableDeferredWipeout: true, deleteDirs: true | ||
// Note: Underlying org.apache DirectoryScanner used by cleanWs has a bug scanning where it misses files containing ".." so use rm -rf instead | ||
// Issue: https://issues.jenkins.io/browse/JENKINS-64779 | ||
if (context.WORKSPACE != null && !context.WORKSPACE.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think if (context.WORKSPACE)
achieves the same thing.
// Issue: https://issues.jenkins.io/browse/JENKINS-64779 | ||
if (context.WORKSPACE != null && !context.WORKSPACE.isEmpty()) { | ||
context.println "Cleaning workspace files: " + context.WORKSPACE + "/*" | ||
context.sh(script: "rm -rf " + context.WORKSPACE + "/*") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this ignores the .
hidden directories (eg. .git
folder). Which is causing me issues on my win boxes.
Add the facility to clean the build workspace or just the workspace/build/src/build and workspace/target binary output at the end of the build. This provides a large saving of disk space, up to 30Gb for Build Output alone and an additional 6Gb for the whole workspace. The default settings for generated pipelines are:
Additionally, cleanWorkspaceAfterBuild can be specified in the jdk platform configuration if a specific platform requires cleaning only.
Signed-off-by: Andrew Leonard [email protected]