Last active
July 18, 2021 04:43
-
-
Save andgineer/aee9022fad89cb8b87e931c8b7de7321 to your computer and use it in GitHub Desktop.
Jenkins groovy function. Loads into Jenkins env from lines "key=value" in `text` https://sorokin.engineer/posts/en/jenkins_load_env_vars_with_expanding.html
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
private void loadVarsFromText(String text) { | |
text.split('\n').each { envLine -> | |
def (key, value) = envLine.tokenize('=') | |
env."${key}" = "${value}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment