Created
March 16, 2013 19:31
-
-
Save stanlemon/5177925 to your computer and use it in GitHub Desktop.
A sample ./.openshift/action_hooks/deploy for Red Hat's OpenShift platform to install composer dependencies upon deployment.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This deploy hook gets executed after dependencies are resolved and the | |
# build hook has been run but before the application has been started back | |
# up again. This script gets executed directly, so it could be python, php, | |
# ruby, etc. | |
export COMPOSER_HOME="$OPENSHIFT_DATA_DIR/.composer" | |
if [ ! -f "$OPENSHIFT_DATA_DIR/composer.phar" ]; then | |
curl -s https://getcomposer.org/installer | /usr/local/zend/bin/php -- --install-dir=$OPENSHIFT_DATA_DIR | |
else | |
/usr/local/zend/bin/php $OPENSHIFT_DATA_DIR/composer.phar self-update | |
fi | |
( unset GIT_DIR ; cd $OPENSHIFT_REPO_DIR ; /usr/local/zend/bin/php $OPENSHIFT_DATA_DIR/composer.phar install ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
one suggestion
/usr/local/zend/bin/php
is different from that ofphp -v
version. So rather than/usr/local/zend/bin/php
I am preferring just php .Thank you for sharing the snippet.