Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dishbreak/484e54a953320cebd3d7e06fa0aeb942 to your computer and use it in GitHub Desktop.
Save dishbreak/484e54a953320cebd3d7e06fa0aeb942 to your computer and use it in GitHub Desktop.
A short script to delete free locks from the lockable resources plugin
def manager = org.jenkins.plugins.lockableresources.LockableResourcesManager.get()
def resources = manager.getResources().findAll{
!it.locked
}
resources.each{
manager.getResources().remove(it)
}
manager.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment