Skip to content

Instantly share code, notes, and snippets.

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 CsBigDataHub/48b3f4cd71833046adbdea2e6a10f704 to your computer and use it in GitHub Desktop.
Save CsBigDataHub/48b3f4cd71833046adbdea2e6a10f704 to your computer and use it in GitHub Desktop.
Print the methods of Jenkins inner object on script console
//all job name
jenkins.model.Jenkins.instance.items.each {
println "Job: ${it.name}"
}
//method list of Jenkins instance
jenkins.model.Jenkins.instance.class.methods.each {
println "Jenkins method: ${it.name}"
}
//method list of Maven2job(hudson.maven.MavenModuleSet)
hudson.maven.MavenModuleSet.class.methods.each {
println "job method: ${it.name}"
}
//method list of Free Style Project(hudson.model.FreeStyleProject)
hudson.model.FreeStyleProject.class.methods.each {
println "job method : ${it.name}"
}
//workspace path of specified job
println(jenkins.model.Jenkins.instance.getJob("jobName").getWorkspace())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment