How to mark Jenkins builds as SUCCESS only on specific error exit values (other than 0)?

后端 未结 6 1430
遥遥无期
遥遥无期 2021-02-14 03:37

When I run an Execute shell build step to execute a script and that script returns 0, Jenkins flags the build as SUCCESS, oth

6条回答
  •  清酒与你
    2021-02-14 04:07

    Can handle it via the Text-finder Plugin:

    • Have your script print the exit-code it is about to exit with, like:
      Failed on XXX - Exiting with RC 2

    • Use the Text-finder Plugin to catch that error-message and mark the build as 'Failed' or 'Unstable',
      for example, if you decide RC 2, 3 and 4 should mark the build as 'Unstable', look for text in this pattern:
      Exiting with RC [2-4].

提交回复
热议问题