Jenkins pipeline: how to get the different paths

1,231 views
Skip to first unread message

thomas....@teamaol.com

unread,
Sep 20, 2016, 3:34:29 AM9/20/16
to Jenkins Users
Hi,

writing a Jenkinsfile like this:

node{
   
def WORKSPACE=pwd()
}

The path is initially empty. The content is stored at pwd() + "@script".

So basically I could use two variables
 - def WORK_PATH=pwd()
 - def SOURCES=pwd() + "@script"

However there is also a @tmp path for the project and when the job runs in parallel we also have numbering in the paths.

Since I'm writing coded pipelines ... I could live with that if I could see
how to access the individial paths. I have not found documentation on this.

Anybody who could help please?

Kind regards,
Thomas

thomas....@teamaol.com

unread,
Sep 20, 2016, 5:10:58 AM9/20/16
to Jenkins Users
One information is "pwd(tmp:true)" which provides the  @tmp path. When same job runs two times in parallel the path provided by pwd(...) returns a path with additionally a number.

Current path:/var/lib/jenkins/workspace/Foo@2
Temp path:/var/lib/jenkins/workspace/Foo@2@tmp

Remains: how do I get the @script Path? 

Baptiste Mathus

unread,
Sep 20, 2016, 1:49:27 PM9/20/16
to jenkins...@googlegroups.com

What are you trying to do?

At first sight, seems to me you're on the path of pain. You seem to be to developing things somehow in the "user" space relying on internal things that may change without any notice IMO.

Just my 2 cents


--
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 jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/3acd3033-b266-4676-9e84-6ca4bad0c902%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages