cancel
Showing results for 
Search instead for 
Did you mean: 

Get absolute path to workspace directory in Jenkins Pipeline plugin

Marquis36
Occasional Visitor

Get absolute path to workspace directory in Jenkins Pipeline plugin

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 env.WORKSPACE:
 

The following variables are currently unavailable inside a workflow script:

NODE_LABELS

WORKSPACE

SCM-specific variables such as SVN_REVISION

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 new File("").absolutePath() inside a @NonCPS section but looks like the non-CPS stuff gets always executed on the master.

Does anybody have a clue how to get this path without running some batch script which stores the path into some file which later on can be read in again?

 

 

OneVanilla.com

2 REPLIES 2
sonya_m
Community Manager

Re: Get absolute path to workspace directory in Jenkins Pipeline plugin

Hi @Marquis36 ! As far as understand, the question is not about a SmartBear plugin, so, unfortunately, the Community might not be able to help you with this one. 


Sonya Mihaljova
Community and Education Specialist


Limited time: Gain insights – and win prizes – with our event “Inside Zephyr”! Runs May 17-28
Margherita123
New Member

Re: Get absolute path to workspace directory in Jenkins Pipeline plugin

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 capital one ("").absolutePath() inside a @NonCPS section but looks like the non -CPS stuff gets always executed on the master.

Does anybody have a clue how to get this path without running some batch script which stores the path into some file which later on can be read in again?  

 

americanexpress/confirmcard

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors