Last active
September 29, 2017 15:16
-
-
Save macg33zr/9d9d5885084ea855c3703c868b1609ed to your computer and use it in GitHub Desktop.
Bill's Jenkins System Groovy Script KB gist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Custom tools | |
// | |
import com.cloudbees.jenkins.plugins.customtools.CustomTool | |
import hudson.tools.InstallSourceProperty | |
import hudson.tools.ZipExtractionInstaller | |
def tools = Jenkins.instance.getDescriptorByType(CustomTool.DescriptorImpl.class) | |
tools.metaClass.methods*.name.sort().unique() | |
def installations = tools.getInstallations() | |
installations.each { tool -> | |
println "Got tool: ${tool}" | |
// Is it a custom tool | |
if (tool instanceof CustomTool) { | |
println "Custom tool: yes" | |
println "Name: ${tool.name}" | |
tool.getProperties().each { prop -> | |
println "tool property: ${prop}" | |
if (prop instanceof InstallSourceProperty) { | |
prop.installers.each { installer -> | |
println "Installer : ${installer}" | |
if (installer instanceof ZipExtractionInstaller) { | |
println "Installer URL: ${installer.getUrl()}" | |
println "Installer DIR: ${installer.getSubdir()}" | |
} | |
} | |
} | |
println "-------------------------------------------------------------\r\n" | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What is going on here with gists and multi files? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment