Forked from nextrevision/jenkins-workflow-dump-environment
Created
April 2, 2021 00:58
-
-
Save john24rel/a68cecb6b790b0fa777cd1b3518013a8 to your computer and use it in GitHub Desktop.
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
| // 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