Jenkins - when downstream project is aborted, abort upstream project

Viewed 69

In my Jenkins I have projects that trigger other projects using Build Triggers and Projects to build

Sometimes, for various legitimate reasons, a downstream project is being aborted automatically (because it's irrelevant or because other more recent build started and so on).

The problem is that it causes the upstream Run to be marked as failed (since its downstream Run was aborted). I want it to be marked as aborted and not as failed. Is this possible?

1 Answers

In a build pipeline, the "projects to build" field is in the Post-build Actions section.

You could add to those post-build action a:

  • post-build tast, looking for aborted
  • combined with a "Fail the build" plugin, which can set the status of the current build to whatever you want, included "aborted".
Related