> *To: *Jenkins Users
> *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 result ( I also give you some hint when things are not
> yet filled)
>
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
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 of
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'
>> deleteDir() /*
>
> 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 {
>
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 :/'