Expanding Parameters when triggering Jobs

14 views
Skip to first unread message

Brantone

unread,
Sep 15, 2014, 9:21:03 PM9/15/14
to jenkins...@googlegroups.com
Perhaps just not using the right terms to look for an answer as I'm thinking this isn't crazy unique.

So "Job A" triggers "Job B".

Job A has a parameter called PROJECT_PATH, whose value = "${WORKSPACE}/project/trunk/".

When triggering Job B choosing "Current Build Parameters", It passes it straight as is, but I want it to expand on "${WORKSPACE}" so it actually uses the value from Job A.

Something simple I'm missing??

Brantone

unread,
Sep 19, 2014, 2:08:58 AM9/19/14
to jenkins...@googlegroups.com
For anyone wondering, I can't remember where I read it, but it doesn't evaluate it unless you pass it as predefined.
When using "current build parameters" it just does it exactly as is, as if it was typed in that way.
The mention/verification was in a random comment somewhere, just can't find it.
Anyway, thread closed.

Jan Seidel

unread,
Sep 19, 2014, 3:46:22 AM9/19/14
to jenkins...@googlegroups.com
${WORKSPACE} is dynamic.
Job A and job B have their own defined workspace and will use different values.
If you want job B to use the same you could pass the value as parameter like:

ALT_WORKSPACE=${WORKSPACE}

Brenton Bartel

unread,
Sep 19, 2014, 3:54:18 AM9/19/14
to jenkins...@googlegroups.com
"${WORKSPACE}" was a poor example ... how about "${SOME_RANDOM_FOLDER}" .. the point was, when param goes to get passed, it doesn't evaluate any nested parameters, just passes it straight text.

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/xgx3snzEgsI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jan Seidel

unread,
Sep 19, 2014, 5:13:12 AM9/19/14
to jenkins...@googlegroups.com

Ah, I got your point :)
use the "Predefined parameters" opton. Then the variables will expand.
See picture attached

Am Dienstag, 16. September 2014 03:21:03 UTC+2 schrieb Brantone:

Brenton Bartel

unread,
Sep 19, 2014, 5:15:44 AM9/19/14
to jenkins...@googlegroups.com
Yeah, that's what I was hoping to avoid.
Simply choosing "Use Current Parameters", and have it auto-magically include the evaluated value ... which is not feasible, so I'm trying to do something it's not meant to do. Hence, thread closed ;)

--
Reply all
Reply to author
Forward
0 new messages