Repository navigation
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.
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 |
sxa
left a comment
There was a problem hiding this comment.
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! ✅ |
sxa
left a comment
There was a problem hiding this comment.
Other than the naming which I think it's now confusing I think this is ready
Signed-off-by: Andrew Leonard <anleonar@redhat.com>
29714a6 to
50bf26e
Compare
|
run tests |
sxa
left a comment
There was a problem hiding this comment.
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.
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.
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 anleonar@redhat.com