Jenkins Pipeline - fail a stage but continue the build

25 322 просмотра
Перейти к первому непрочитанному сообщению

Stefan Golas

не прочитано,
3 янв. 2017 г., 11:10:1303.01.2017
– Jenkins Users
Hello,
I would like to fail a stage in a pipeline job without aborting the build (pipeline). Is there a way?

regards Stefan

Andrew Bayer

не прочитано,
3 янв. 2017 г., 14:15:1203.01.2017
– jenkins...@googlegroups.com
There's no *easy* way to do this - in Declarative + Blue Ocean, we now have this capability, but it relies on adding some additional metadata to the "failed" stage that Blue Ocean reads. That said, if you don't care about the visualization (i.e., the stage is marked as passed in Blue Ocean or the Stage View, the build continues, but at the end of the build the whole build is marked as failed), catchError will do the trick - https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#code-catcherror-code-catch-error-and-set-build-result

A.

--
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/6cfbefd9-99da-40a1-afe2-5005c72a5b5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cameron Jeffries

не прочитано,
22 февр. 2018 г., 02:55:2822.02.2018
– Jenkins Users
Can you please link to the syntax for the Blue Ocean metadata to use?  I'm having trouble finding it.


On Tuesday, January 3, 2017 at 11:15:12 AM UTC-8, Andrew Bayer wrote:
There's no *easy* way to do this - in Declarative + Blue Ocean, we now have this capability, but it relies on adding some additional metadata to the "failed" stage that Blue Ocean reads. That said, if you don't care about the visualization (i.e., the stage is marked as passed in Blue Ocean or the Stage View, the build continues, but at the end of the build the whole build is marked as failed), catchError will do the trick - https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#code-catcherror-code-catch-error-and-set-build-result

A.
On Tue, Jan 3, 2017 at 8:10 AM, 'Stefan Golas' via Jenkins Users <jenkins...@googlegroups.com> wrote:
Hello,
I would like to fail a stage in a pipeline job without aborting the build (pipeline). Is there a way?

regards Stefan

--
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.

Baptiste Mathus

не прочитано,
22 февр. 2018 г., 14:07:3922.02.2018
– jenkins...@googlegroups.com
Andrew was referring to adding code into Blue Ocean itself, not something doable for end users.

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/d162304a-f064-4fb3-8cfd-8728ea283025%40googlegroups.com.

Raz Lubinsky

не прочитано,
2 сент. 2019 г., 05:40:3702.09.2019
– Jenkins Users
right now there is a new option

read first comment here:

although I must admit that I had a problem with it 
and if you can help me there I will be more than happy:
Ответить всем
Отправить сообщение автору
Переслать
0 новых сообщений