Hi

According to the documentation for the Parameterized Trigger plugin,
specifically for 'Predefined parameters":

"""
KEY=value pairs, one per line (Java properties file format).
Backslashes are used for escaping, so use "\\" for a single backslash.

Current build parameters and/or environment variables can be used in
form: ${PARAM} or $PARAM
"""

I'm trying to use this to pass the contents of an environment variable
to the next job in line, but it is not passed. In Job1 is essentially
the execution of the following script:

#!/bin/bash
# display job parameters
echo "JOB_NAME = $JOB_NAME"
echo "BUILD_NUMBER = $BUILD_NUMBER"
export PREFIX=/build/$JOB_NAME/$BUILD_NUMBER/lal
echo "Installing in $PREFIX"

And in the "Predetermined parameters" section I have:

LAL_JOB_NAME=$JOB_NAME
LAL_BUILD_NUMBER=$BUILD_NUMBER
LAL_PREFIX=$PREFIX

When Job1 completes successfully and outputs:

JOB_NAME = LALSuite/LAL/label=sl6
BUILD_NUMBER = 6
Installing in /build/LALSuite/LAL/label=sl6/6/lal
Finished: SUCCESS

It then triggers Job2 which is essentially the following script:

#!/bin/bash
# show parameters
echo "LAL_JOB_NAME = $LAL_JOB_NAME"
echo "LAL_BUILD_NUMBER = $LAL_BUILD_NUMBER"
echo "LAL_PREFIX = $LAL_PREFIX"

When executed Job2 displays:

LAL_JOB_NAME = LALSuite/LAL
LAL_BUILD_NUMBER = 6
LAL_PREFIX = ${PREFIX}

So the contents of JOB_NAME isn't being passed correctly the value of
the PREFIX environment variable is being completely ignored.

How can I pass the contents of an environment variable to another job
using the parameterized trigger plugin? Or is there another plugin
that would be better in this situation?

Cheers

Adam

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to