Sorry for the delay - I didn't notice your update.
I expect the WORKSPACE variable to contain the path value to the workspace directory for the current job.
Maybe the setup I used isn't that straight forward. Also I just realized that my testsetup is not what I expected. I missed the point that setting a custom workspace directory - using a relative path - gets appended to either JENKINS_HOME or the remote root directory for slaves.
Sorry for the troubles.
But one last point I almost missed is that setting environment variables using envinject ignores case sensitivity. Using the following example:
FLAGS=someValue
flags=someOtherValue
kills the second variable and only FLAGS will finally be set.
Code changed in jenkins
User: Gregory Boissinot
Path:
src/main/java/org/jenkinsci/plugins/envinject/EnvInjectBuildWrapper.java
src/main/java/org/jenkinsci/plugins/envinject/EnvInjectBuilder.java
src/main/java/org/jenkinsci/plugins/envinject/EnvInjectListener.java
src/main/java/org/jenkinsci/plugins/envinject/EnvInjectLogger.java
src/main/java/org/jenkinsci/plugins/envinject/service/EnvInjectVariableGetter.java
http://jenkins-ci.org/commit/envinject-plugin/8fdee0a1a42b310b5a1bbfb00f38414fbb001b21
Log:
Fixed
JENKINS-12027