Created
February 3, 2017 17:57
-
-
Save visitbethel/a009e8ac15793567e212545dd58b46d0 to your computer and use it in GitHub Desktop.
Jenksin Pipeline JSON Config Slurp to Avoid Serializable
This file contains 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
import groovy.json.JsonSlurperClassic | |
@NonCPS | |
def jsonParse(def json) { | |
new groovy.json.JsonSlurperClassic().parseText(json) | |
} | |
node('master') { | |
def config = jsonParse(readFile("config.json")) | |
def db = config["database"]["address"] | |
... | |
} | |
#NOTE : JsonSlurperClassic needs to be approved for usage... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment