Re: Translation between declaritive pipleline and groovy pipeline

2017-12-05 Thread Stephen Connolly
nt: *04 December 2017 17:06 > *To: *Jenkins Users <jenkinsci-users@googlegroups.com> > *Subject: *Re: Translation between declaritive pipleline and groovy > pipeline > > > > You need to wrap your groovy code into a try/catch/finally block and check > the current build res

RE: Translation between declaritive pipleline and groovy pipeline

2017-12-05 Thread Daniel Butler
If you use currentBuild.currentResult (was added a few months ago IIRC) you get a value that will never be null. From: jer...@bodycad.com Sent: 04 December 2017 17:06 To: Jenkins Users Subject: Re: Translation between declaritive pipleline and groovy pipeline You need to wrap your groovy code

Re: Translation between declaritive pipleline and groovy pipeline

2017-12-04 Thread jerome
You need to wrap your groovy code into a try/catch/finally block and check the current build result ( I also give you some hint when things are not yet filled) try { } catch(any) { println('Error occurred during build:'); println(any.toString()); println('Marking build as FAILURE because

Re: Translation between declaritive pipleline and groovy pipeline

2017-12-04 Thread Peter Berghold
Kool! Thanks! I suspected as much but now I full understand what's going on. On Mon, Dec 4, 2017 at 1:15 AM Ramanathan Muthaiah wrote: > What would be the equivalent of this: >> >> post { >> always { >> echo 'One way or another, I have finished' >>

Re: Translation between declaritive pipleline and groovy pipeline

2017-12-03 Thread Ramanathan Muthaiah
> > What would be the equivalent of this: > > post { > always { > echo 'One way or another, I have finished' > deleteDir() /* clean up our workspace */ > } > success { > echo 'I succeeeded!' > } > unstable { >

Translation between declaritive pipleline and groovy pipeline

2017-12-03 Thread Peter Berghold
What would be the equivalent of this: post { always { echo 'One way or another, I have finished' deleteDir() /* clean up our workspace */ } success { echo 'I succeeeded!' } unstable { echo 'I am unstable :/'