Thanks Sverre. That marks the build as failed though. 

Doing a return between nodes is what I was looking for to exit without 
changing the build result. 

On Wednesday, 29 June 2016 17:20:34 UTC+10, Sverre Moe wrote:
>
> You could use the error step:
> error 'Error message'
>
> https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#code-error-code-error-signal
>
> mandag 30. mai 2016 09.21.16 UTC+2 skrev Feng Yu følgende:
>>
>> Hi there:
>>     Here is my pipeline code:
>> node{
>>     // my code here
>>     try {
>>         // some steps
>>         currentBuild.result = 'SUCCESS'
>>     } catch (Exception err) {
>>         currentBuild.result = 'FAILURE'
>>         mail  // email to me if failed
>>         // some clean steps
>>     }
>>
>>     if (currentBuild.result == 'FAILURE') {
>>         // How to exit pipeline ?
>>     }
>>
>>     /*
>>      * other steps here
>>      */
>> }
>>
>>
>> How do I break the pipeline manually if some steps failed?
>>
>> Thanks.
>>
>

-- 
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 
https://groups.google.com/d/msgid/jenkinsci-users/9556d548-5a72-41f3-8a9d-2b26ff449567%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to