[ 
https://issues.jenkins-ci.org/browse/JENKINS-8952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=159487#comment-159487
 ] 

cjo9900 commented on JENKINS-8952:
----------------------------------

looks to be the same as point 2 in 
https://issues.jenkins-ci.org/browse/JENKINS-12415

2. Exported variable from shell not passed to called jobs.
When doing export BUILD_JAVA=1 from a shell script this does not get passed 
back into the job environment setting so these are only used within the context 
of that shell script and spawned processes.
To show this add a second shell build step and print the environment variables 
using env an then check for the exported item, you will see it is not present.

To pass these values along to later build steps print them to a file in the 
standard parameter format of KEY=VALUE and then use the EnvInject plugin build 
step to add them to the run environment from the file created

Suggest closing the error as there is no real changes that can be made to 
change the current behaviour as it is a known core issue with a solution as 
defined above
                
> Not Expanding Environment Variable
> ----------------------------------
>
>                 Key: JENKINS-8952
>                 URL: https://issues.jenkins-ci.org/browse/JENKINS-8952
>             Project: Jenkins
>          Issue Type: Bug
>          Components: parameterized-trigger
>         Environment: Jenkins Parameterized Trigger plugin ver. 2.7
> Jenkins ver. 1.397
> Ubuntu 10.04.1 LTS
>            Reporter: Nathan Nutter
>            Assignee: huybrechts
>
> I have crated a new job and when using the parameterized trigger it is 
> passing a literal '$VAR' instead of expanding $VAR.
> Here is some output from the job that is setting the variable (GIT_DESCRIBE): 
> {quote}[workspace] $ /gsc/bin/bash -xe /tmp/hudson7947017773698263236.sh
> ++ git describe --tags
> + GIT_DESCRIBE=0.28-103-g0661244
> + export GIT_DESCRIBE
> + env
> + grep GIT_DESCRIBE
> GIT_DESCRIBE=0.28-103-g0661244
> Description set: 0.28-103-g0661244{quote}
> Using a predefined parameter I have "GIT_DESCRIBE=${GIT_DESCRIBE}" (without 
> quotes) in the text field.
> Then the receiving job has the value of GIT_DESCRIBE as "${GIT_DESCRIBE}". If 
> I start this job an enter a value for the GIT_DESCRIBE parameter as 
> "0.28-103-g0661244" not only does it work but it also passes this value 
> correctly onto the third/final job.
> P.S. I've never submitted a bug for Hudson/Jenkins before so please let me 
> know if I am not doing this correctly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to