What are Jenkins build statuses SUCCESS, UNSTABLE, FAILURE, ABORTED and NOT_BUILT?

BeginnerConceptJenkins
Answer
  • SUCCESS: all steps passed.
  • UNSTABLE: build ran but tests failed or a quality threshold was missed (yellow).
  • FAILURE: a step errored (red).
  • ABORTED: stopped by a user, a timeout, or a newer build.
  • NOT_BUILT: skipped, for example because an upstream stage failed.

junit marks the build UNSTABLE when tests fail, so if you want a hard failure you must check currentBuild.result or use catchError/error.

All CI/CD questions

More on Jenkins