Get absolute path to workspace directory in Jenkins Pipeline plugin
<p>I'm currently doing some evaluation on the Jenkins Pipeline plugin (formerly know as Workflow plugin).
Reading the documentation I found out that I currently cannot retriev the workspace path using
<code>env.WORKSPACE</code>:</p>
<blockquote>
<p>The following variables are currently unavailable inside a workflow script:</p>
<p>NODE_LABELS</p>
<p>WORKSPACE</p>
<p>SCM-specific variables such as SVN_REVISION</p>
</blockquote>
<p>Is there any other way how to get the absolute path to the current workspace? I need this running some test which in turn gets some parameter (absolute path to some executable file).
I already tried using <code>new File(&quot;&quot;).absolutePath()</code> inside a <code>@NonCPS</code> section but looks like the non-CPS stuff gets always executed on the master.</p>
<p>Does anybody have a clue how to get this path <em>without</em> running some batch script which stores the path into some file which later on can be read in again?</p>