Bug 1018665 - [deploy]php cartridge does not execute build hook
[deploy]php cartridge does not execute build hook
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Andy Goldstein
libra bugs
Depends On:
  Show dependency treegraph
Reported: 2013-10-14 02:41 EDT by Zhe Wang
Modified: 2015-05-14 19:30 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-01-23 22:23:53 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Zhe Wang 2013-10-14 02:41:13 EDT
Description of problem:
Given a PHP-5.3 app, it does not execute the build hook during its build cycle, but it does execute pre_build, deploy and post_deploy hook.

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

How reproducible:

Steps to Reproduce:
1. create a php-5.3 app

2. create a build hook with the following code, and make it executable
#! /bin/bash
echo "----Build Fail Test----"
touch  /var/lib/openshift/:app_uuid/app-root/runtime/repo/build_test
exit 1

3. push the change and trigger a build

Actual results:
The build succeeded, but neither the expected string was printed in stdout during interactive activation nor the build_test file was created.

Expected results:
The build hook should be executed.

Additional info:
Comment 1 Andy Goldstein 2013-10-18 10:41:00 EDT
There are a few things here:

The echo not being displayed was fixed by https://bugzilla.redhat.com/show_bug.cgi?id=1016977

If you want to create a file inside the repo in a hook, you must now use $OPENSHIFT_REPO_DIR, as ~/app-root/runtime/repo may not be valid at build time now.

The fact that the build succeeds when the build hook has a non-zero exit is a problem and I am working to fix it.
Comment 2 Andy Goldstein 2013-10-18 11:13:58 EDT
Comment 3 openshift-github-bot 2013-10-18 14:13:25 EDT
Commit pushed to master at https://github.com/openshift/origin-server

Bug 1018665

Reraise the ShellExecutionException in build() so it's seen as a
failure and halts the deployment
Comment 4 Zhe Wang 2013-10-20 23:42:15 EDT
Verified in devenv_3921

After creating a build hook with the following code:

#! /bin/bash
echo "----Build Fail Test----"
exit 1

the build process was aborted:

Building PHP cartridge
----Build Fail Test----
An error occurred executing 'gear build' (exit code: 1)
Error message: Failed to execute action hook 'build' for 5264a201ab3b098bc2000359 application phptstbldr

Note You need to log in before you can comment on or make changes to this bug.