This gives me the workspace of the job. But I want the root directory
which I set when I create a new slave node in Jenkins.

So, as an example, I create a new slave node. The root directory i am
setting there is /home/jenkins.
Currently, when I run a job, I get "/home/jenkins/workspace/Some Job
Name" when running pwd(). But I want only this "/home/jenkins" stuff.


2017-01-09 17:54 GMT+01:00 Slide <[email protected]>:
> You can use pwd, to get it.
>
> node() {
>    ROOT = pwd()
> }
>
> On Mon, Jan 9, 2017 at 9:45 AM Kristian <[email protected]> wrote:
>>
>> Hi,
>>
>> do someone knows how to get the root directory of a node in a Pipeline
>> script?
>>
>> --
>> 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].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/CAO5HUhMvCZXGLe91bb4W%3DpHGH470C2QbVF5CX70XdeL0aYm5_A%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVfJ0UjVfPnQhq8rTsj6Sde9uCUKOopQzJfLRRegLiWE1Q%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAO5HUhOBwpNj0aEoB3G_sWYaZAExoakgmSX9udSx7CvQQeCYdw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to