During the first build, I am running the following:

                    result.each { key, val ->
                        env.setProperty(key,val)
                    }

Where result contains a set of key value pairs I want to set. If I do this 
I can see those variables on the environment in that build.
In my next build, I am running the following:

                    def staticNumber = 22
                    def job = 
Jenkins.instance.getItemByFullName('my-job-name')
                    def builds = job.builds
                    def buildByNum = builds.find { it.number == 
staticNumber }
                    echo 
"${buildByNum.getEnvironment(buildByNum.getListener())}"
                    echo "${buildByNum.getEnvVars()}"

Even though the environment was updated on the previous build, when I read 
it from the new build it is missing the new properties. I have read 
multiple SO articles about how getEnvVars() is very limited. 

Is there a way to have the key/value pairs from 'result' be available to 
the new build? It doesn't have to be through env, I just figured that would 
be the most simple.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5b119415-0e48-49d2-a7f0-db6a8750c142%40googlegroups.com.

Reply via email to