Created
June 10, 2020 17:52
-
-
Save ktor/f69e0718eda61a2e99516199f605bc33 to your computer and use it in GitHub Desktop.
Access global jenkins properties from jenkins https://plugins.jenkins.io/extensible-choice-parameter/ groovy script
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
| // source: https://stackoverflow.com/a/41160217/1180235 | |
| import jenkins.model.* | |
| nodes = Jenkins.instance.globalNodeProperties | |
| nodes.getAll(hudson.slaves.EnvironmentVariablesNodeProperty.class) | |
| envVars = nodes[0].envVars | |
| envVars['MY_GLOBAL_PROPERTY'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment