Bug 1018643

Summary: [deploy]Build lifecycle does not check the exit status after pre_build hook
Product: OpenShift Online Reporter: Zhe Wang <zhewang>
Component: ContainersAssignee: Andy Goldstein <agoldste>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-24 03:23:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Zhe Wang 2013-10-14 03:45:58 UTC
Description of problem:
When triggering a Jenkins build of a given app, the build lifecycle does not check the exit status after pre_build hook, as a consequence, even the pre_build hook fails, the build process will still continue. Currently, the following cartridges are covered, and the list will be appended in comments, if there are others:

PHP-5.3

Version-Release number of selected component (if applicable):
devenv_3893

How reproducible:
always

Steps to Reproduce:
1. create an app with jenkins-client embedded

2. create a pre_build hook with the following code:
#! /bin/bash
echo "----Pre_Build Fail Test----"
exit 1

3. push the change and trigger a Jenkins build

4. check the Jenkins build log

5. add a deploy or post_deploy hook, and repeat Step 2 ~ 5

Actual results:
The jenkins build in Step 3 succeeded. Moreover, when checking the build log, we can see the string "----Pre_Build Fail Test----", but the Jenkins build was not blocked due to the non-zeor exit code.

On the other hand, the build process was blocked when the exit code after deploy or post_deploy hook was non-zero.

Expected results:
The build lifecycle should check the exit status of each action hook which is at presence.

Additional info:

Comment 1 Zhe Wang 2013-10-14 05:55:00 UTC
Other cartridges affected:

Zend
Python-2.6
Perl-5.10

Comment 2 Andy Goldstein 2013-10-18 16:01:26 UTC
https://github.com/openshift/origin-server/pull/3926

Comment 3 Zhe Wang 2013-10-21 03:44:09 UTC
Verified in devenv_3921