I am part of the team maintaining the Team Concert plugin for Jenkins -
https://wiki.jenkins-ci.org/display/JENKINS/Team+Concert+Plugin.

We are seeing a restriction with accessing the env object in pipeline
scripts. We contribute environment variables to a run. If the env object is
not accessed before SCM checkout runs, then accessing the environment
variables contributed by the Team Concert plugin, returns the appropriate
values. But if the env object is accessed before the checkout runs, then
accessing the environment variables contributed by the Team Concert plugin,
even after checkout runs, always return null.

For example, assuming that the Team Concert plugin contributes the
environment variable "TC_ENV_VAR1". Then the following script returns the
value set by the Team Concert plugin, for TC_ENV_VAR1.

    checkout(<scm_parameters>)
    echo "${env.TC_ENV_VAR1}"

But the following script returns a null value for "TC_ENV_VAR1"

    echo "${env.BUILD_NUMBER}"
    checkout(<scm_parameters>)
    echo "${env.TC_ENV_VAR1}"

We contribute environment variables through an implementation of
hudson.model.EnvironmentContributor.

Could there be any additional implementation that is required to invalidate
or refresh the environment variables, in case the env object was already
constructed?

Thanks & Regards,
Sridevi

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CADM3cT76C%2BYff0XBx3uEpiL-OqOis5%3Dnk06hD71NWsKTfWq3yg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to