Skip to content

Instantly share code, notes, and snippets.

@martinda
Last active November 23, 2015 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinda/6848c7550429cdb79c8c to your computer and use it in GitHub Desktop.
Save martinda/6848c7550429cdb79c8c to your computer and use it in GitHub Desktop.
Using echo in jenkins workflow method
HashMap<String,String> cfg
node() {
echo("test")
String str = readFile file: '/home/martin/a.config'
cfg = getConfig(str)
echo(cfg)
echo("cfg: "+cfg)
}
@NonCPS HashMap<String,String> getConfig(String text) {
HashMap<String,String> map = new HashMap<>()
ConfigObject cfg = new ConfigSlurper().parse(text)
map.put("a", cfg.a)
return map
}
echo("cfg: "+cfg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment