I think job B would see SVN_REVISION not SVN_REVISION_NUMBER because you are 
setting SVN_REVISION in the post-build section.  We use the "triggger/call 
builds on other projects" for the build step and it works perfectly fine to 
call job B from job A and echo the predefined parameters passed to it.  We use 
this to have a general deploy job that takes the server and instance as 
parameters from the more specific deploy job i.e. deploy_test calls deploy_web 
and passes the test server and instance as a parameter and this all works 
correctly.

Will

On 01/11/2013 02:05 PM, Stanley, Jason wrote:
I ran into this very same problem.

It appears (at least with my experience) the only variables passed from Job A 
-> Job B are the variables predefined by Jenkins.

To work around the issue,  in my build shell for Job A, I wrote the 
variable=value into a file and used the “Parameters from properties file”  
Parameter in the “Trigger parameterized build on other projects” when running 
Job B.

Jason

From: jenkinsci-users@googlegroups.com<mailto:jenkinsci-users@googlegroups.com> 
[mailto:jenkinsci-users@googlegroups.com] On Behalf Of zw
Sent: Friday, January 11, 2013 2:50 PM
To: jenkinsci-users@googlegroups.com<mailto:jenkinsci-users@googlegroups.com>
Subject: How to pass parameters between jobs - quick question

Hi All

We have job A to kick off Job B
Job A uses in build section execute shell to get a svn revision number and sets 
SVN_REVISION.
(We understand that there's the option to use "This build is parameterized" 
String Parameter and set SVN_REVISION value as HEAD, but we have our reasons to 
not use that)
echo ${SVN_REVISION_NUM}
export SVN_REVISION=${SVN_REVISION_NUM}
echo ${SVN_REVISION}


output

+ SVN_REVISION_NUM=47337

:

+ echo 47337

47337

+ export SVN_REVISION=47337

+ SVN_REVISION=47337



In Post-build Actions section

we have Trigger parameterized build on other projects, and predefined parameter 
set to SVN_REVISION=${SVN_REVISION_NUM}



But in Job B console, it dosent see the revision number and Job B's SCM could 
retrieve the revision number

Location 'https://jobBhost.com/svn/src@${SVN_REVISION_NUM}' does not exist



What did we do wrong ?



Thanks



Reply via email to