Re: pipeline - groovy - file paths on windows?

2016-10-18 Thread Rachel
Hi Jonathan,

Thanks for the information. I'll follow the new thread.

Best regards,
Rachel

El martes, 18 de octubre de 2016, 1:17:13 (UTC+2), Jonathan Hodgson 
escribió:
>
> Rachel and Martina,
>
> Thanks for trying to help me on this, I've started a new thread now that 
> I've realized the issue isn't to do with windows or paths, but rather to do 
> with slaves and masters.
>
> On Monday, October 17, 2016 at 11:27:08 PM UTC+1, Jonathan Hodgson wrote:
>>
>> Well I can confirm that it has nothing to do with it being windows, just 
>> tried FileNameFinder on my OSX slave and it also looks on the master
>>
>> On Monday, October 17, 2016 at 9:44:03 PM UTC+1, Jonathan Hodgson wrote:
>>>
>>> But I don't want to restrict where the job runs, just where the node 
>>> runs.
>>>
>>> I have code that needs to run on the master, and code that needs to run 
>>> on the slaves.
>>>
>>> The code is running in the correct places, I can for example do a 
>>> mercurial checkout on the slaves, I can also run batch files on the slaves, 
>>> and visual studio (or I could, that bit's disabled as I'm working on this, 
>>> but it worked before).
>>>
>>> Buildsteps do what they should, on the slave
>>>
>>> but groovy file commands don't.
>>>
>>> On Monday, October 17, 2016 at 9:19:45 PM UTC+1, Rachel wrote:

 Hi Jonathan,

 According to master and slave systems you have, I think you might use 
 the option:

- "*Restrict where this project can be run*"

 in your job configuration (located in General Configuration), in order *to 
 force job execution on slave*.

 I hope be useful.

 Best regards,
 Rachel


 El lunes, 17 de octubre de 2016, 22:07:09 (UTC+2), Jonathan Hodgson 
 escribió:
>
>
>
> On Monday, October 17, 2016 at 8:36:55 PM UTC+1, Martina wrote:
>>
>> So you solved the issue of it running on the wrong system, right?
>>
>
> No, I haven't solved the issue.
>
> I thought perhaps it was running on the wrong system because it didn't 
> have an absolute path that it recognized as such, so I was trying to see 
> if 
> there was a path syntax which made it look locally, so far, no luck
>
> Well, all the "does not exist" messages have a leading /.
>> Not sure where that comes from, but I'm pretty sure that that is what 
>> it is complaining about. Also, looking at FileNameFinder, all examples 
>> are 
>> it finding files, not directories, but examples are clearly using 
>> c:/path/path syntax.
>> I'm thinking you may want to try changing up your wildcard to 
>> something like '**/*.xml' or '**/*.txt', whatever you actually have on 
>> that 
>> file system.
>>
>> FilenameFinder works as expected on the master, but not on the slave. 
> It doesn't matter what my wildcard is, it always looks on the master. The 
> same goes for File... which seems to be the complete opposite of what the 
> documentation on File and FilePath says. If I understand that correctly, 
> File is always supposed to look on the current machine (i.e. the one that 
> node is running on) and so to access stuff on the master you have to use 
> FilePath
>
>
>

-- 
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/c6767fd5-5fdd-4941-9255-7c41ef4d1e33%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pipeline - groovy - file paths on windows?

2016-10-17 Thread Jonathan Hodgson
Rachel and Martina,

Thanks for trying to help me on this, I've started a new thread now that 
I've realized the issue isn't to do with windows or paths, but rather to do 
with slaves and masters.

On Monday, October 17, 2016 at 11:27:08 PM UTC+1, Jonathan Hodgson wrote:
>
> Well I can confirm that it has nothing to do with it being windows, just 
> tried FileNameFinder on my OSX slave and it also looks on the master
>
> On Monday, October 17, 2016 at 9:44:03 PM UTC+1, Jonathan Hodgson wrote:
>>
>> But I don't want to restrict where the job runs, just where the node runs.
>>
>> I have code that needs to run on the master, and code that needs to run 
>> on the slaves.
>>
>> The code is running in the correct places, I can for example do a 
>> mercurial checkout on the slaves, I can also run batch files on the slaves, 
>> and visual studio (or I could, that bit's disabled as I'm working on this, 
>> but it worked before).
>>
>> Buildsteps do what they should, on the slave
>>
>> but groovy file commands don't.
>>
>> On Monday, October 17, 2016 at 9:19:45 PM UTC+1, Rachel wrote:
>>>
>>> Hi Jonathan,
>>>
>>> According to master and slave systems you have, I think you might use 
>>> the option:
>>>
>>>- "*Restrict where this project can be run*"
>>>
>>> in your job configuration (located in General Configuration), in order *to 
>>> force job execution on slave*.
>>>
>>> I hope be useful.
>>>
>>> Best regards,
>>> Rachel
>>>
>>>
>>> El lunes, 17 de octubre de 2016, 22:07:09 (UTC+2), Jonathan Hodgson 
>>> escribió:



 On Monday, October 17, 2016 at 8:36:55 PM UTC+1, Martina wrote:
>
> So you solved the issue of it running on the wrong system, right?
>

 No, I haven't solved the issue.

 I thought perhaps it was running on the wrong system because it didn't 
 have an absolute path that it recognized as such, so I was trying to see 
 if 
 there was a path syntax which made it look locally, so far, no luck

 Well, all the "does not exist" messages have a leading /.
> Not sure where that comes from, but I'm pretty sure that that is what 
> it is complaining about. Also, looking at FileNameFinder, all examples 
> are 
> it finding files, not directories, but examples are clearly using 
> c:/path/path syntax.
> I'm thinking you may want to try changing up your wildcard to 
> something like '**/*.xml' or '**/*.txt', whatever you actually have on 
> that 
> file system.
>
> FilenameFinder works as expected on the master, but not on the slave. 
 It doesn't matter what my wildcard is, it always looks on the master. The 
 same goes for File... which seems to be the complete opposite of what the 
 documentation on File and FilePath says. If I understand that correctly, 
 File is always supposed to look on the current machine (i.e. the one that 
 node is running on) and so to access stuff on the master you have to use 
 FilePath




-- 
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/453dd417-9f6d-487f-9ff0-c0140bcdee28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pipeline - groovy - file paths on windows?

2016-10-17 Thread Jonathan Hodgson
Well I can confirm that it has nothing to do with it being windows, just 
tried FileNameFinder on my OSX slave and it also looks on the master

On Monday, October 17, 2016 at 9:44:03 PM UTC+1, Jonathan Hodgson wrote:
>
> But I don't want to restrict where the job runs, just where the node runs.
>
> I have code that needs to run on the master, and code that needs to run on 
> the slaves.
>
> The code is running in the correct places, I can for example do a 
> mercurial checkout on the slaves, I can also run batch files on the slaves, 
> and visual studio (or I could, that bit's disabled as I'm working on this, 
> but it worked before).
>
> Buildsteps do what they should, on the slave
>
> but groovy file commands don't.
>
> On Monday, October 17, 2016 at 9:19:45 PM UTC+1, Rachel wrote:
>>
>> Hi Jonathan,
>>
>> According to master and slave systems you have, I think you might use the 
>> option:
>>
>>- "*Restrict where this project can be run*"
>>
>> in your job configuration (located in General Configuration), in order *to 
>> force job execution on slave*.
>>
>> I hope be useful.
>>
>> Best regards,
>> Rachel
>>
>>
>> El lunes, 17 de octubre de 2016, 22:07:09 (UTC+2), Jonathan Hodgson 
>> escribió:
>>>
>>>
>>>
>>> On Monday, October 17, 2016 at 8:36:55 PM UTC+1, Martina wrote:

 So you solved the issue of it running on the wrong system, right?

>>>
>>> No, I haven't solved the issue.
>>>
>>> I thought perhaps it was running on the wrong system because it didn't 
>>> have an absolute path that it recognized as such, so I was trying to see if 
>>> there was a path syntax which made it look locally, so far, no luck
>>>
>>> Well, all the "does not exist" messages have a leading /.
 Not sure where that comes from, but I'm pretty sure that that is what 
 it is complaining about. Also, looking at FileNameFinder, all examples are 
 it finding files, not directories, but examples are clearly using 
 c:/path/path syntax.
 I'm thinking you may want to try changing up your wildcard to something 
 like '**/*.xml' or '**/*.txt', whatever you actually have on that file 
 system.

 FilenameFinder works as expected on the master, but not on the slave. 
>>> It doesn't matter what my wildcard is, it always looks on the master. The 
>>> same goes for File... which seems to be the complete opposite of what the 
>>> documentation on File and FilePath says. If I understand that correctly, 
>>> File is always supposed to look on the current machine (i.e. the one that 
>>> node is running on) and so to access stuff on the master you have to use 
>>> FilePath
>>>
>>>
>>>

-- 
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/3bb3377a-dfbe-44b6-b33d-29329515b5f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pipeline - groovy - file paths on windows?

2016-10-17 Thread Jonathan Hodgson
But I don't want to restrict where the job runs, just where the node runs.

I have code that needs to run on the master, and code that needs to run on 
the slaves.

The code is running in the correct places, I can for example do a mercurial 
checkout on the slaves, I can also run batch files on the slaves, and 
visual studio (or I could, that bit's disabled as I'm working on this, but 
it worked before).

Buildsteps do what they should, on the slave

but groovy file commands don't.

On Monday, October 17, 2016 at 9:19:45 PM UTC+1, Rachel wrote:
>
> Hi Jonathan,
>
> According to master and slave systems you have, I think you might use the 
> option:
>
>- "*Restrict where this project can be run*"
>
> in your job configuration (located in General Configuration), in order *to 
> force job execution on slave*.
>
> I hope be useful.
>
> Best regards,
> Rachel
>
>
> El lunes, 17 de octubre de 2016, 22:07:09 (UTC+2), Jonathan Hodgson 
> escribió:
>>
>>
>>
>> On Monday, October 17, 2016 at 8:36:55 PM UTC+1, Martina wrote:
>>>
>>> So you solved the issue of it running on the wrong system, right?
>>>
>>
>> No, I haven't solved the issue.
>>
>> I thought perhaps it was running on the wrong system because it didn't 
>> have an absolute path that it recognized as such, so I was trying to see if 
>> there was a path syntax which made it look locally, so far, no luck
>>
>> Well, all the "does not exist" messages have a leading /.
>>> Not sure where that comes from, but I'm pretty sure that that is what it 
>>> is complaining about. Also, looking at FileNameFinder, all examples are it 
>>> finding files, not directories, but examples are clearly using c:/path/path 
>>> syntax.
>>> I'm thinking you may want to try changing up your wildcard to something 
>>> like '**/*.xml' or '**/*.txt', whatever you actually have on that file 
>>> system.
>>>
>>> FilenameFinder works as expected on the master, but not on the slave. It 
>> doesn't matter what my wildcard is, it always looks on the master. The same 
>> goes for File... which seems to be the complete opposite of what the 
>> documentation on File and FilePath says. If I understand that correctly, 
>> File is always supposed to look on the current machine (i.e. the one that 
>> node is running on) and so to access stuff on the master you have to use 
>> FilePath
>>
>>
>>

-- 
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/22e776a8-7c2a-44a4-98a9-5b5883889e01%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pipeline - groovy - file paths on windows?

2016-10-17 Thread Rachel
Hi Jonathan,

According to master and slave systems you have, I think you might use the 
option:

   - "*Restrict where this project can be run*"

in your job configuration (located in General Configuration), in order *to 
force job execution on slave*.

I hope be useful.

Best regards,
Rachel


El lunes, 17 de octubre de 2016, 22:07:09 (UTC+2), Jonathan Hodgson 
escribió:
>
>
>
> On Monday, October 17, 2016 at 8:36:55 PM UTC+1, Martina wrote:
>>
>> So you solved the issue of it running on the wrong system, right?
>>
>
> No, I haven't solved the issue.
>
> I thought perhaps it was running on the wrong system because it didn't 
> have an absolute path that it recognized as such, so I was trying to see if 
> there was a path syntax which made it look locally, so far, no luck
>
> Well, all the "does not exist" messages have a leading /.
>> Not sure where that comes from, but I'm pretty sure that that is what it 
>> is complaining about. Also, looking at FileNameFinder, all examples are it 
>> finding files, not directories, but examples are clearly using c:/path/path 
>> syntax.
>> I'm thinking you may want to try changing up your wildcard to something 
>> like '**/*.xml' or '**/*.txt', whatever you actually have on that file 
>> system.
>>
>> FilenameFinder works as expected on the master, but not on the slave. It 
> doesn't matter what my wildcard is, it always looks on the master. The same 
> goes for File... which seems to be the complete opposite of what the 
> documentation on File and FilePath says. If I understand that correctly, 
> File is always supposed to look on the current machine (i.e. the one that 
> node is running on) and so to access stuff on the master you have to use 
> FilePath
>
>
>

-- 
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/41b4d9df-3fef-4c44-a880-309b6c13d2c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pipeline - groovy - file paths on windows?

2016-10-17 Thread Jonathan Hodgson


On Monday, October 17, 2016 at 8:36:55 PM UTC+1, Martina wrote:
>
> So you solved the issue of it running on the wrong system, right?
>

No, I haven't solved the issue.

I thought perhaps it was running on the wrong system because it didn't have 
an absolute path that it recognized as such, so I was trying to see if 
there was a path syntax which made it look locally, so far, no luck

Well, all the "does not exist" messages have a leading /.
> Not sure where that comes from, but I'm pretty sure that that is what it 
> is complaining about. Also, looking at FileNameFinder, all examples are it 
> finding files, not directories, but examples are clearly using c:/path/path 
> syntax.
> I'm thinking you may want to try changing up your wildcard to something 
> like '**/*.xml' or '**/*.txt', whatever you actually have on that file 
> system.
>
> FilenameFinder works as expected on the master, but not on the slave. It 
doesn't matter what my wildcard is, it always looks on the master. The same 
goes for File... which seems to be the complete opposite of what the 
documentation on File and FilePath says. If I understand that correctly, 
File is always supposed to look on the current machine (i.e. the one that 
node is running on) and so to access stuff on the master you have to use 
FilePath


-- 
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/66009643-6192-4d88-b472-8a594bceebe7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pipeline - groovy - file paths on windows?

2016-10-17 Thread Martina
So you solved the issue of it running on the wrong system, right?
Well, all the "does not exist" messages have a leading /.
Not sure where that comes from, but I'm pretty sure that that is what it is 
complaining about. Also, looking at FileNameFinder, all examples are it 
finding files, not directories, but examples are clearly using c:/path/path 
syntax.
I'm thinking you may want to try changing up your wildcard to something 
like '**/*.xml' or '**/*.txt', whatever you actually have on that file 
system.

hth
Martina

On Monday, October 17, 2016 at 12:36:54 PM UTC-6, Jonathan Hodgson wrote:
>
> I've tried every path variation I can think of
>
> def paths = [
> "c:",
> "c:\\",
> "c:\\Jenkins",
> "c:\\Jenkins\\workspace\\",
> "c:\\Jenkins\\workspace\\WPF-TryBuild",
>"c:/",
> "c:/Jenkins",
> "c:/Jenkins/workspace/",
> "c:/Jenkins/workspace/WPF-TryBuild",
> "C:\\",
> "C:\\Jenkins",
> "C:\\Jenkins\\workspace\\",
> "C:\\Jenkins\\workspace\\WPF-TryBuild",
> "C:/",
> "C:/Jenkins",
> "C:/Jenkins/workspace/",
> "C:/Jenkins/workspace/WPF-TryBuild"
> ]
> for (path in paths)
> {
> try {
> def hg_folders = new FileNameFinder().getFileNames(path, '*')
> echo "SUCCESS!! Found $path"
> }
> catch(Exception err) {
> echo "There was a problem finding $path"
> echo err.getMessage()
> }
> }
>
>
> The result is this
>
> [Windows] There was a problem finding c:
> [Windows] /c: does not exist.
>
> [Windows] There was a problem finding c:\
> [Windows] /c: does not exist.
>
> [Windows] There was a problem finding c:\Jenkins
> [Windows] /c:/Jenkins does not exist.
>
> [Windows] There was a problem finding c:\Jenkins\workspace\
> [Windows] /c:/Jenkins/workspace does not exist.
>
> [Windows] There was a problem finding c:\Jenkins\workspace\WPF-TryBuild
> [Windows] /c:/Jenkins/workspace/WPF-TryBuild does not exist.
>
> [Windows] There was a problem finding c:/
> [Windows] /c: does not exist.
>
> [Windows] There was a problem finding c:/Jenkins
> [Windows] /c:/Jenkins does not exist.
>
> [Windows] There was a problem finding c:/Jenkins/workspace/
> [Windows] /c:/Jenkins/workspace does not exist.
>
> [Windows] There was a problem finding c:/Jenkins/workspace/WPF-TryBuild
> [Windows] /c:/Jenkins/workspace/WPF-TryBuild does not exist.
>
> [Windows] There was a problem finding C:\
> [Windows] /C: does not exist.
>
> [Windows] There was a problem finding C:\Jenkins
> [Windows] /C:/Jenkins does not exist.
>
> [Windows] There was a problem finding C:\Jenkins\workspace\
> [Windows] /C:/Jenkins/workspace does not exist.
>
> [Windows] There was a problem finding C:\Jenkins\workspace\WPF-TryBuild
> [Windows] /C:/Jenkins/workspace/WPF-TryBuild does not exist.
>
> [Windows] There was a problem finding C:/
> [Windows] /C: does not exist.
>
> [Windows] There was a problem finding C:/Jenkins
> [Windows] /C:/Jenkins does not exist.
>
> [Windows] There was a problem finding C:/Jenkins/workspace/
> [Windows] /C:/Jenkins/workspace does not exist.
>
> [Windows] There was a problem finding C:/Jenkins/workspace/WPF-TryBuild
> [Windows] /C:/Jenkins/workspace/WPF-TryBuild does not exist.
>
>
> Those paths most certainly do exist, 
>

-- 
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/4c3fafce-30a0-4d41-9253-fcdaee3bd84e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pipeline - groovy - file paths on windows?

2016-10-17 Thread Jonathan Hodgson
I've tried every path variation I can think of

def paths = [
"c:",
"c:\\",
"c:\\Jenkins",
"c:\\Jenkins\\workspace\\",
"c:\\Jenkins\\workspace\\WPF-TryBuild",
   "c:/",
"c:/Jenkins",
"c:/Jenkins/workspace/",
"c:/Jenkins/workspace/WPF-TryBuild",
"C:\\",
"C:\\Jenkins",
"C:\\Jenkins\\workspace\\",
"C:\\Jenkins\\workspace\\WPF-TryBuild",
"C:/",
"C:/Jenkins",
"C:/Jenkins/workspace/",
"C:/Jenkins/workspace/WPF-TryBuild"
]
for (path in paths)
{
try {
def hg_folders = new FileNameFinder().getFileNames(path, '*')
echo "SUCCESS!! Found $path"
}
catch(Exception err) {
echo "There was a problem finding $path"
echo err.getMessage()
}
}


The result is this

[Windows] There was a problem finding c:
[Windows] /c: does not exist.

[Windows] There was a problem finding c:\
[Windows] /c: does not exist.

[Windows] There was a problem finding c:\Jenkins
[Windows] /c:/Jenkins does not exist.

[Windows] There was a problem finding c:\Jenkins\workspace\
[Windows] /c:/Jenkins/workspace does not exist.

[Windows] There was a problem finding c:\Jenkins\workspace\WPF-TryBuild
[Windows] /c:/Jenkins/workspace/WPF-TryBuild does not exist.

[Windows] There was a problem finding c:/
[Windows] /c: does not exist.

[Windows] There was a problem finding c:/Jenkins
[Windows] /c:/Jenkins does not exist.

[Windows] There was a problem finding c:/Jenkins/workspace/
[Windows] /c:/Jenkins/workspace does not exist.

[Windows] There was a problem finding c:/Jenkins/workspace/WPF-TryBuild
[Windows] /c:/Jenkins/workspace/WPF-TryBuild does not exist.

[Windows] There was a problem finding C:\
[Windows] /C: does not exist.

[Windows] There was a problem finding C:\Jenkins
[Windows] /C:/Jenkins does not exist.

[Windows] There was a problem finding C:\Jenkins\workspace\
[Windows] /C:/Jenkins/workspace does not exist.

[Windows] There was a problem finding C:\Jenkins\workspace\WPF-TryBuild
[Windows] /C:/Jenkins/workspace/WPF-TryBuild does not exist.

[Windows] There was a problem finding C:/
[Windows] /C: does not exist.

[Windows] There was a problem finding C:/Jenkins
[Windows] /C:/Jenkins does not exist.

[Windows] There was a problem finding C:/Jenkins/workspace/
[Windows] /C:/Jenkins/workspace does not exist.

[Windows] There was a problem finding C:/Jenkins/workspace/WPF-TryBuild
[Windows] /C:/Jenkins/workspace/WPF-TryBuild does not exist.


Those paths most certainly do exist, 

-- 
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/ba5de980-98e7-4b38-89d5-5bb5bc3a0e82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pipeline - groovy - file paths on windows?

2016-10-17 Thread Jonathan Hodgson
I've just done some experimentation, and 

testfile = new File("/tmp/CheckOnServer.txt")
if (testfile.exists())
{
echo "It's looking on the master"
}
else
{
echo "It's not looking on the master"
}



gives

[Pipeline] [Windows] echo[Windows] It's looking on the master



Now [Windows] is my slave (the master is a linux machine), but, as the 
message says, that file it is finding is on the master.

Paths seem to be failing because it's starting in the wrong place.


On Monday, October 17, 2016 at 3:44:39 PM UTC+1, Martina wrote:
>
> What exactly is the value of ${source_folder_name} that is in the message?
> C:/some-dir/some-other-name should definitely work.
>
> Martina
>>
>>   
>>
>

-- 
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/61d38fe8-e800-44cf-a2e4-3560997c196e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pipeline - groovy - file paths on windows?

2016-10-17 Thread Martina
What exactly is the value of ${source_folder_name} that is in the message?
C:/some-dir/some-other-name should definitely work.

Martina
>
>   
>

-- 
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/4a99a741-43c8-41d7-983c-424f1d514f58%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pipeline - groovy - file paths on windows?

2016-10-17 Thread Jonathan Hodgson


On Saturday, October 15, 2016 at 6:05:45 PM UTC+1, Rachel wrote:
>
> Hi Jonathan,
>
> You might check:
>
>- When it's said "Source folder  does not exist", check that 
> really exists and it's right.
>- Jenkins process on slave has permissions on that path.
>
> I hope be useful.
>
> Best regards,
> Rachel
>
>
>>
Hi Rachel,

It certainly does exist.

Looking at the documentation, it seems that paths like "C:" should work, 
but they don't seem to.

Perhaps there is some subtlety about the path syntac that I'm missing?

  

-- 
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/cb050e62-f21e-47d9-8d03-3de4af540d65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pipeline - groovy - file paths on windows?

2016-10-15 Thread Rachel
Hi Jonathan,

You might check:

   - When it's said "Source folder  does not exist", check that  
   really exists and it's right.
   - Jenkins process on slave has permissions on that path.

I hope be useful.

Best regards,
Rachel

El sábado, 15 de octubre de 2016, 0:17:25 (UTC+2), Jonathan Hodgson 
escribió:
>
> Hi,
>
> I have a bit of code that looks like this
>
> def source_folder_name = "${pwd()}/${destination}"
> def source_folder = new File(source_folder_name)
> if (!source_folder.exists())
> {
> echo "Source folder ${source_folder_name} does not exist"
> }
> else
> {
> echo "Deleting folder ${source_folder_name}"
> source_folder.deleteDir()
> }
>
> Now on Linux (on the master) it works fine.
>
> On Windows (on a slave) it insists the folder does not exist, even though 
> it does.
>
> The folder is on the local machine in both cases.
>
> I have tried replacing all forward slashes in the path with backslashes, 
> and vice-versa but it doesn't seem to make any difference.
>
> Am I missing something?
>
>

-- 
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/edfeedf6-b875-44ac-b423-3f6307cf2649%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


pipeline - groovy - file paths on windows?

2016-10-14 Thread Jonathan Hodgson
Hi,

I have a bit of code that looks like this

def source_folder_name = "${pwd()}/${destination}"
def source_folder = new File(source_folder_name)
if (!source_folder.exists())
{
echo "Source folder ${source_folder_name} does not exist"
}
else
{
echo "Deleting folder ${source_folder_name}"
source_folder.deleteDir()
}

Now on Linux (on the master) it works fine.

On Windows (on a slave) it insists the folder does not exist, even though 
it does.

The folder is on the local machine in both cases.

I have tried replacing all forward slashes in the path with backslashes, 
and vice-versa but it doesn't seem to make any difference.

Am I missing something?

-- 
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/5c872088-0e5d-4dd3-ab9f-885658813778%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.