Sounds like you need to put the function where the sh is called into a @NonCPS decorator on that function.
@NonCPS
def MyFct() {
sh(“ls”);
}
That should remove the need for serialization of that command ainto this function.
--
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-use...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/5f27436c-2c6b-4039-abfc-1496d239b981o%40googlegroups.com.
Sounds like you need to put the function where the sh is called into a @NonCPS decorator on that function.
@NonCPS
def MyFct() {
sh(“ls”);
}
That should remove the need for serialization of that command ainto this function.
From: jenkins...@googlegroups.com <jenkins...@googlegroups.com> On Behalf Of chencho m-a
Sent: June 8, 2020 9:41 AM
To: Jenkins Users <jenkins...@googlegroups.com>
Subject: sh vs execute
Hi all,
I am suffering a weird issue with sh when i am calling a simple ls from a groovy script inside jenkins, but if I use execute().text, it works fine.
Why does sh return java.lang.UNIXProcess an throw NonSerializableException and execute() works fine?
thank you.
--
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 jenkins...@googlegroups.com.