Strongly reproduced with scripttrigger plugin
jenkins core: 1.492
evinject: 1.82
scripttrigger: 0.26, 0.23
steps to reproduce:
- JOB1. create any job that polls using scripttrigger plugin with poling node = master
- JOB2. create job which is restricted to run on master and uses envinject
- (restart jenkins - looks like it is needed)
- run JOB2
The results is that $WORKSPACE of JOB2 is defined correctly before envinject, but then it is re-defined with $WORKSPACE of job which use scripttrigger (JOB1).
==========
Started by user ...
[EnvInject] - Loading node environment variables.
Building on master in workspace /jenkins/jobs/JOB2/workspace
[EnvInject] - Executing scripts and injecting environment variables after the SCM step.
[EnvInject] - Executing and processing the following script content:
A=aaaa
[workspace] $ /bin/sh -xe /tmp/hudson5302730654246338218.sh
+ A=aaaa
[EnvInject] - Script executed successfully.
[workspace] $ /bin/sh -xe /tmp/hudson6529723899012472418.sh
+ echo /jenkins/jobs/JOB1/workspace
/jenkins/jobs/JOB1/workspace
Notifying upstream projects of job completion
Finished: SUCCESS
===========
Can it be related that envinject and scripttrigger use different envinject-lib ?
envinject uses envinject-lib-1.15.jar while scripttrigger uses envinject-lib-1.16.jar ?
Strange behavior.
I don't know where it is from and I can't reproduce it.
Could you try to isolate it?
Are your sure?