Last active
February 13, 2018 22:32
-
-
Save t3knoid/b255ee97377067c1ccfc026f0aa1d678 to your computer and use it in GitHub Desktop.
Jenkins Groovy script to return build environment variables
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
// This does not work if Use Groovy Sandbox is enabled | |
// Execute this as a system Groovy script in Jenkins | |
def thr = Thread.currentThread() | |
def build = thr?.executable | |
def env = build.parent.builds[0].properties.get("envVars") | |
env.each{ | |
println it | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment