-
Bug
-
Resolution: Fixed
-
Major
-
None
-
RHEL 6.2
When the build status is set as FAILURE by a triggered Build in a pre-build step, the current build status is not recognised in a post-build conditional step, and the step in performed regardless of the condition.
Steps to reproduce:
- create a freestyle project 'i_will_fail'
- add step "run shell" with "exit 1" as content
- create maven project
- add pre-build step Trigger 'i_will_fail'
- block job until 'i_will_fail' returns...leave default marks build as.
- for the main build some test pom.xml and goals validate (this is irrelevant)
- post-steps - run regardless of result
- add a conditional post-build step with current build status success.
- this step will run even if the build has been marked as failed in the pre-build step.
Here is the output from a test I made.
Started by user lostinberlin [EnvInject] - Loading node environment variables. Building in workspace /var/lib/jenkins/jobs/_lostinberlin_Sandbox_Maven/workspace Run condition [Current build status] enabling prebuild for step [Execute shell] Run condition [Current build status] enabling prebuild for step [Execute shell] [workspace] $ /bin/sh -xe /tmp/hudson3522507109509654665.sh + echo '_lostinberlin_Sandbox_Maven : Starting...' _lostinberlin_Sandbox_Maven : Starting... Waiting for the completion of _lostinberlin_Sandbox _lostinberlin_Sandbox #18 completed. Result was FAILURE Build step 'Trigger/call builds on other projects' marked build as failure Run condition [Current build status] enabling perform for step [Execute shell] [workspace] $ /bin/sh -xe /tmp/hudson3662062057434345391.sh + echo '_lostinberlin_Sandbox_Maven : In post-build steps. I should not be run...' _lostinberlin_Sandbox_Maven : In post-build steps. I should not be run... Notifying upstream projects of job completion Finished: FAILURE
The issues can also be reproduced with a simple shell builder (instead of triggering an other project).
But the bug actually is in the maven plugin, the result of the prebuild steps are not correctly propagated and therefore the post build steps have no chance to react as expected.