Hi, it depends on where in your code you are trying to use this. A workspace is only available (and the env set) while inside a node or ws block. And beware, when different parts of the pipeline run on different node, then each part has it's own workspace, possibly even at different locations. And unless there are strong requirements for absolute pathes, better just use relative pathes (all steps will by default have the WORKSPACE as current working dir).
Björn Am Donnerstag, 30. November 2017 21:48:15 UTC+1 schrieb Peter Berghold: > > I am most interested in using the "WORKSPACE" value in the enviromental > values. within my pipeline.. I use it as a base to create a staging > directory from so I have a value defined such as: > > def outrepo="${env.WORKSPACE}/shipping-${env.BUILD_NUMBER}" > > what I am getting back from that is not what I'm expecting at all. > > OUTREPO: null/shipping-152 > > > Looks like env.WORKSPACE is being resolved as a "null" instead of the full > path to the job's workspace. > > > Is there a different form of this I should be using? I clearly see WORKSPACE > as being defined when within a shell I see that value running the shell > command "env." > > > I could hard code it I supposed, but that kind defeats the purpose a bit.... > > > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ff698027-6d29-476c-b04b-ac2397561c9e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.