Skip to content

Instantly share code, notes, and snippets.

@viccherubini
Created November 3, 2013 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viccherubini/7289793 to your computer and use it in GitHub Desktop.
Save viccherubini/7289793 to your computer and use it in GitHub Desktop.
Expert PHP Deployments build-dev script.
#!/bin/bash
PHPMINVERSION='5.5.0'
PHPVERSION=`php -r "echo phpversion();"`
PHPCORRECTVERSION=`php -r "echo version_compare(phpversion(), '$PHPMINVERSION');"`
GREEN="\033[1;32m"
RED="\033[1;31m"
BLUE="\033[1;34m"
YELLOW="\033[1;33m"
ENDCOLOR="\033[0m"
echo -e "${BLUE}[BEGIN]${ENDCOLOR} Beginning Application development build process."
echo
echo -e "${BLUE}[CHECK]${ENDCOLOR} ./config/build.settings exists."
if [ ! -f ./app/config/build.settings ]
then
echo -e "${RED}[FAILURE]${ENDCOLOR} The ./config/build.settings file does not exist. Create it from ./config/build.settings.template."
exit 1
fi
echo -e "${GREEN}[OK]${ENDCOLOR} ./config/build.settings exists."
echo
echo -e "${BLUE}[INSTALL]${ENDCOLOR} Installing Composer."
curl -s https://getcomposer.org/installer | php >/dev/null 2>&1
chmod +x composer.phar
echo -e "${BLUE}[INSTALL]${ENDCOLOR} Installing PHPUnit."
wget -qO phpunit.phar http://pear.phpunit.de/get/phpunit.phar -O phpunit.phar
echo
echo -e "${BLUE}[INSTALL]${ENDCOLOR} Installing Phing."
wget -qO phing.phar http://www.phing.info/get/phing-2.6.1.phar
echo
echo -e "${BLUE}[BEGIN]${ENDCOLOR} Building the Application project."
if [ ! -d "log" ]; then
mkdir log
fi
php phing.phar -Dbuild_settings_file=config/build.settings build
echo -e "${GREEN}[FINISHED]${ENDCOLOR} Building the Application project."
echo
echo -e "${GREEN}####################################################################${ENDCOLOR}"
echo -e "${GREEN}# [SUCCESS] The Application project is ready to go! #${ENDCOLOR}"
echo -e "${GREEN}####################################################################${ENDCOLOR}"
echo
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment