-
Notifications
You must be signed in to change notification settings - Fork 123
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
[JENKINS-65612] Support for immediately cleaning @libs
workspaces
#110
base: master
Are you sure you want to change the base?
Conversation
Why not just implement |
I could see an argument for also implementing that by default under the general principle of not leaking resources. But I think this PR has independent value. Let me explain why. We (unfortunately) use a lot of static agents, and we want to keep builds as isolated as possible. So our shared library has a def call(Map params = [:], Closure closure) {
def cleanupClosure = {
try {
it()
} finally {
cleanWs()
}
}
node(params.label) {
if (params.workspace) {
ws(params.workspace) {
cleanupClosure(closure)
}
} else {
cleanupClosure(closure)
}
}
} which we use universally as a generic substitute for We've found the above quite useful, so I also think we would find the feature in this PR useful for the same reason (opt-in, of course, rather than by default). |
Done in #115. |
#115 merged, closing this pr |
@car-roll read #110 (comment) |
As of #172 most of the code in this plugin has been moved to another plugin repository so this PR must be closed. If this change is still needed, please git clone https://github.com/jenkinsci/pipeline-groovy-lib-plugin
cd pipeline-groovy-lib-plugin
git checkout -b JENKINS-65612
git pull https://github.com/basil/workflow-cps-global-lib-plugin JENKINS-65612 resolve any merge conflicts, and file a fresh PR on the new repository. Be sure to paste a link to this old PR to enable bidirectional navigation. |
See JENKINS-65612.
SCMRetriever
andSCMSourceRetriever
create a@libs
workspace for retrieving the shared library before copying it into the build directory. While old build directories are eventually discarded based on the global build discarder configuration, these@libs
workspaces tend to stick around for a long time and eventually need to be removed. It would be nice if a flag could be set onSCMRetriever
andSCMSourceRetriever
to clean these@libs
workspaces immediately after we are done with them.