1

There are 4 kind gerrit command in gerrit plugin settings. Success / Fail / Unstable / Not Built.

I could return "success/fail" from my job to gerrit plugin, by using exit 0/1, And "success/fail" gerrit command was executed. But I don't Understand how to return "Not Built" by shellscript. Please teach me.

sorry for my poor english. Thanks.

H.H
  • 364
  • 3
  • 11

2 Answers2

0

Success / Failure / Unstable

  1. If the job has no test reports configured:

    • If the last build command executed by Jenkins exits with failure (<> 0) exit code, the build is considered to be failed.

    • If the last build command exits with success (= 0) exit code, the build is successful.

  2. If the job has one or more test reports configured:

    • If the last build command executed by Jenkins exits with failure (<> 0) exit code, the build is considered to be failed.

    • If the last build command exits with success (= 0) exit code but test reports have some failed tests, the build is unstable.

    • If the last build command exits with success and all test have passed, the build is stable.

The only other way to get "Unstable" result is through the use of some post-build plugins (like static code analysis for example).

Not Built

I'm not sure about this item... but I think (guess) the build is considered not build when the job finishes by a timeout.

  • thx for detail answer.I understand "Not Built" cannot be set explicitly by user. – H.H Feb 16 '17 at 10:40
0

I found out way of force stopping by following command

curl http://127.0.0.1:8080/job/${JOB_NAME}/${BUILD_NUMBER}/stop

and gerrit command for "Not Build" was executed .

H.H
  • 364
  • 3
  • 11