Skip to content

Instantly share code, notes, and snippets.

@nextrevision
Created April 13, 2016 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nextrevision/5516145a4a8eeca14e4f0be3f4c14d6c to your computer and use it in GitHub Desktop.
Save nextrevision/5516145a4a8eeca14e4f0be3f4c14d6c to your computer and use it in GitHub Desktop.
// from http://stackoverflow.com/a/34520110
node {
echo "I am a "+getClass().getName()
echo "PARAMETERS"
echo "=========="
echo getBinding().getVariables().getClass().getName()
def myvariables = getBinding().getVariables()
for (v in myvariables) {
echo "${v} " + myvariables.get(v)
}
echo STRING_PARAM1.getClass().getName()
echo "METHODS"
echo "======="
def methods = getMetaClass().getMethods()
for (method in methods) {
echo method.getName()
}
echo "PROPERTIES"
echo "=========="
properties.each{ k, v ->
println "${k} ${v}"
}
echo properties
echo properties["class"].getName()
echo "ENVIRONMENT VARIABLES"
echo "======================"
echo "env is " + env.getClass().getName()
def envvars = env.getEnvironment()
envvars.each{ k, v ->
println "${k} ${v}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment