Skip to content

Instantly share code, notes, and snippets.

@cvakiitho
Created April 6, 2021 14:34
Show Gist options
  • Save cvakiitho/06e09b0a1e098944eb9c5de02321ad4d to your computer and use it in GitHub Desktop.
Save cvakiitho/06e09b0a1e098944eb9c5de02321ad4d to your computer and use it in GitHub Desktop.
Jenkins list everything
println "\nfunctions\n***********"
println this.steps.functions.collect { k,v -> v.getFunctionName()}
println "\nstepClassNames\n***********"
println this.steps.stepClassNames.collect { k,v -> v.getFunctionName()}
println "\nunreportedAmbiguousFunctions\n***********"
println this.steps.unreportedAmbiguousFunctions.collect { k,v -> v.getFunctionName() }
println "\nallGlobalVariables\n***********"
println org.jenkinsci.plugins.workflow.cps.GlobalVariable.forRun(currentBuild.rawBuild).collect { var -> var.getName() }
println "\nallSymbols\n***********"
println getAllSymbols().collectMany { symbol -> org.jenkinsci.plugins.structs.SymbolLookup.getSymbolValue(symbol) }
@NonCPS
def getAllSymbols() {
return org.jvnet.hudson.annotation_indexer.Index.list(
org.jenkinsci.Symbol.class,
jenkins.model.Jenkins.get().pluginManager.uberClassLoader,
Class.class)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment