In Hudson – Get Project Specific Environment Variables

Interestingly I was able to get the environment variables for a build which could be useful for others that need to be able to get at the Hudson specific environment variables:

1
2
3
def job = hudson.model.Hudson.instance.getItem("JobToGet")
def envVars= job.lastBuild.properties.get("envVars")
println envVars["ANT_OPTS"]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>