Skip to content

Instantly share code, notes, and snippets.

@witokondoria
Created October 11, 2016 12:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save witokondoria/878d0a82156765f631a6f3909658f7b2 to your computer and use it in GitHub Desktop.
Save witokondoria/878d0a82156765f631a6f3909658f7b2 to your computer and use it in GitHub Desktop.
scripting console reachable at ${JENKINS_HOME}/script allows us to perform multiple maintenance operations
Raw
def JOB = 'QA/CD'
def start = 1
def end = 1
Jenkins.instance.getItemByFullName(JOB).builds.findAll {
it.number >= start && it.number <= end
}.each {
it.delete()
}
Jenkins.instance.pluginManager.plugins.each{
plugin ->
println ("${plugin.getDisplayName()} (${plugin.getShortName()}) -> ${plugin.getVersion()} ${plugin.isActive()}")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment