Created
January 25, 2014 19:23
-
-
Save unisys12/264fab215d2baa71389d to your computer and use it in GitHub Desktop.
Bash script to download and install PhalconPHP in a DIY Openshfit Cartridge.
This file contains hidden or 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 | |
phalcon=${OPENSHIFT_REPO_DIR}/cphalcon | |
function download_phalcon() { | |
#mkdir -p ${OPENSHIFT_REPO_DIR} | |
cd ${OPENSHIFT_REPO_DIR} | |
pushd ${OPENSHIFT_REPO_DIR} | |
echo "Downloading PhalconPHP" | |
git clone --depth=1 git://github.com/phalcon/cphalcon.git | |
build_phalcon | |
} | |
function build_phalcon() { | |
# Check if original Phalcon install is in dir | |
# if so delete it, so we can bring in new one | |
if [ -e ${phalcon}/build/install ]; then | |
#delete original install script | |
echo "Deleting original install script" | |
rm -v ${phalcon}/build/install | |
fi | |
#copy new install script used for Openshift | |
echo "Coping new install script for Openshift" | |
cp ${OPENSHIFT_REPO_DIR}/.openshift/tmpl/install ${phalcon}/build/ | |
# Install PhalconPHP | |
echo "Installing Phalcon!" | |
cd ${phalcon}/build/ | |
sudo ./install | |
# Clean Build directory | |
echo "Cleaning up the build directory" | |
rm -rf ${phalcon} | |
} | |
check_phalcon() { | |
if [ ! -e ${phalcon}/build/32bits/phalcon.c ]; then | |
echo "Phalcon not installed... let's do that now!" | |
download_phalcon | |
else | |
echo "Phalcon already downloaded, let's try to build it!" | |
build_phalcon | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment