[Pipeline] Mark single step/script as UNSTABLE

1,261 views
Skip to first unread message

Breitbach, Steffen

unread,
Jul 19, 2017, 9:43:15 AM7/19/17
to jenkins...@googlegroups.com

Hi everyone!

 

Is there a way to mark a single step (or script) in a declarative Jenkins pipeline as "UNSTABLE"?

 

I know how to mark the entire pipeline as UNSTABLE and how to mark a single step as FAILED instead of STABLE, but that's not what I need.

 

Something like "currentStep.result = 'UNSTABLE'" would be handy.

 

I haven't found something yet, assuming there isn't a solution for this, but I thought I'll give it a shot and try asking here...

 

Best regards

  Steffen

 

Michael Pailloncy

unread,
Jul 19, 2017, 6:22:03 PM7/19/17
to jenkins...@googlegroups.com
To my knowledge, it's not possible to change the result of a single step. However, you can check the result code of your script and then set the result of the entire pipeline to UNSTABLE using returnStatus parameter, available for sh, powershell and bat steps.

Alternatively, it's planned to have the ability to change the status of a single stage : see JENKINS-26522
The scope of this issue is wider than your need though, but it's in progress :-)


--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/5E63738AB9896844AF1601A1D094677317A6BF6B%40SMBXKO2.cgm.ag.
For more options, visit https://groups.google.com/d/optout.

Breitbach, Steffen

unread,
Jul 20, 2017, 2:09:57 AM7/20/17
to jenkins...@googlegroups.com

Hi Michael,

 

1.    thanks for your response! I reckon that JENKINS-45579 too is one of the issues regarding this.

 

I was hoping for something similar to "Exit code to set build unstable" in the "Execute shell" build step. Guess I'll have to wait then :)

 

Best regards

  Steffen

 

From: jenkins...@googlegroups.com [mailto:jenkins...@googlegroups.com] On Behalf Of Michael Pailloncy
Sent: Thursday, July 20, 2017 12:22 AM
To: jenkins...@googlegroups.com
Subject: Re: [Pipeline] Mark single step/script as UNSTABLE

 

To my knowledge, it's not possible to change the result of a single step. However, you can check the result code of your script and then set the result of the entire pipeline to UNSTABLE using returnStatus parameter, available for sh, powershell and bat steps.

 

Alternatively, it's planned to have the ability to change the status of a single stage : see JENKINS-26522

The scope of this issue is wider than your need though, but it's in progress :-)

 

2017-07-19 15:42 GMT+02:00 Breitbach, Steffen <steffen....@cgm.com>:

Hi everyone!

 

Is there a way to mark a single step (or script) in a declarative Jenkins pipeline as "UNSTABLE"?

 

I know how to mark the entire pipeline as UNSTABLE and how to mark a single step as FAILED instead of STABLE, but that's not what I need.

 

Something like "currentStep.result = 'UNSTABLE'" would be handy.

 

I haven't found something yet, assuming there isn't a solution for this, but I thought I'll give it a shot and try asking here...

 

Best regards

  Steffen

 

--

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.

 

--

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/CAPO77c2nbzM_gK9tO3oiiRyhNJdi%2BpdGGPNr-2EFNmWwPxuMjg%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages