On Thu, Dec 5, 2013 at 6:43 AM, Mandeville, Rob <[email protected]> wrote:
> So you have to calculate the file on the master?
>
> You can't propagate environment variables to slave except when they start.  
> However, you can write a properties file on the master (probably in a 
> well-defined location rather than just "env.properties" as I have said below) 
> and have whatever jobs need the variables download the file from the master 
> and inject files from it.  So on the master, you would have:
>
> rm -f env.properties
> touch env.properties
> echo "BRANCH = `some_command_that_calculates_branch` >> env.properties
> echo TIMESTAMP = `date` >> env.properties
> mv -f env.properties /usr/local/well-known-location/env.properties
>
> Doing it this way (rather than writing to 
> /usr/local/well-known-location/env.properties directly) guarantees that 
> /usr/local/well-known-location/env.properties is a complete file at any time.

Doesn't that invite a race condition if multiple jobs run
concurrently?   (Assuming they need different values...),

-- 
   Les Mikesell
     [email protected]

-- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to