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() }
"Source folder <path> does not exist", check that <path> really exists and it's right.
Jenkins process on slave has permissions on that path.
I hope be useful.
Best regards,
Rachel
Hi Jonathan,
You might check:
- When it's said
"Source folder <path> does not exist", check that <path> really exists and it's right.
Jenkins process on slave has permissions on that path.
I hope be useful.
Best regards,
Rachel
${source_folder_name} that is in the message?
C:/some-dir/some-other-name should definitely work.
Martina
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" }
[Pipeline] [Windows] echo
[Windows] It's looking on the master
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() } }
[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.
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.