On Tuesday, October 18, 2016 at 3:21:09 PM UTC+1, Jesse Glick wrote:
> On Tuesday, October 18, 2016 at 8:09:56 AM UTC-4, Jonathan Hodgson wrote:
>> Did you miss my last post? I tried FilePath, but I get a "unable to 
>> resolve class" error.
> Do not attempt to use `FilePath` from Pipeline script. It will not work.

Thanks, You've saved me a lot of wasted time trying to find how to make it 
work, though I've already lost way too much. I really wish this stuff was 

it also begs the question "Why?", Iask because I was looking at pipeline 
step plugins to see if I could find clues as to how to get the channel, and 
I see that FilePath is how they work. So it seems that FilePaths are 
working in the pipeline, just not in Groovy in the pipeline.

> I'm in a powerfull object oriented cross platform language, but to do 
>> anything useful I have to drop into platform specific archaic shell 
>> environments? Writing clunky code which has to be different for each 
>> platform
> There are plenty of platform-independent scripting languages out there. 
> Ruby, Python, etc. Groovy (run as an external process!), for that matter.

Yes, but even then things are messy. All I'm doing is checking for a 
certain set of subfolders, comparing them with a list, and deleting the 
ones which aren't on the list.

Now on the master, where File works, that's actually quite a simple task 
thanks to the power of Groovy. A few lines of code right there where 
they're needed. 

But it seems to do the same thing on the slave, I basically have to write a 
separate application and call it through sh or bat, passing parameters to 
it (either as environment variables or as command line arguments I guess, 
neither of which is very clean).

One way is simple, neat and easy to maintain. The other is ugly and clunky.

Can you understand why I think that's a significant omission in the design 
of the pipeline?

When you say "groovy run as an external process", do you mean calling it 
through bat/sh, or is there a cleaner way?

> I've had zero success getting sh to work on windows
Use `bat` on Windows. There is a `isUnix` step that may be used to select a 
> Unix-vs.-Windows variant.

That's what I've been doing. But since I repeatedly have to execute 
effectively the same thing on windows and Unix, that's a lot of isUnix, and 
almost repeated code (almost because shell and bat are not compatible, 

Now it looks like sh is supposed to be supported on windows if I have a 
shell installed, so I tried using that, but I couldn't get it to work. It 
called the shell ok (though even there   there's an issue as I recall, 
since the shell path configuration setting is a global one, but my unix 
machines don't have shell in the same place as the windows ones) but it 
didn't seem to be able to actually find the shell script that was generated.

All these things can be worked around of course, but every work around is 
another bit of bloat which makes things harder to understand and maintain.

Thanks again for letting me know about FilePath being a dead end

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 
For more options, visit https://groups.google.com/d/optout.

Reply via email to