Re: Define a class inside a groovy pipeline?

2017-12-01 Thread Peter Berghold
you end up with class with the same name as the groovy file. Inside >> the class you can call pipeline steps and access the global variables like >> it’s a pipeline script. However I don’t think you can have anything other >> than a no-arg constructor. >> >> >> >> >&

Re: Define a class inside a groovy pipeline?

2017-12-01 Thread Peter Berghold
; methods you end up with class with the same name as the groovy file. Inside > the class you can call pipeline steps and access the global variables like > it’s a pipeline script. However I don’t think you can have anything other > than a no-arg constructor. > > > > > > Rega

RE: Define a class inside a groovy pipeline?

2017-12-01 Thread Daniel Butler
iel. From: Peter Berghold Sent: 01 December 2017 18:02 To: Jenkins Users Subject: Define a class inside a groovy pipeline? So I was playing around and tried something.   Here's a class I defined: class MyClass implements Serializable {    MyClass() {   }   def bark(){      sh 'echo W

Define a class inside a groovy pipeline?

2017-12-01 Thread Peter Berghold
So I was playing around and tried something. Here's a class I defined: class MyClass implements Serializable { MyClass() { } def bark(){ sh 'echo WOOF!' } } and so I instantiate it def mc = new MyClass() and I access my method mc.bark() and I get hudson.remoting.ProxyExceptio