Added Branch support (#44)

moved command line argument processing to a separate script so it can be
shared
added --use-system-master to allow user to use master branch instead of
detected master
This commit is contained in:
Mafoo
2016-09-29 17:57:50 +01:00
committed by FusionPBX
parent 0ba5e906b2
commit eda28f4efd
4 changed files with 70 additions and 42 deletions

View File

@@ -1,13 +1,29 @@
#!/bin/sh
#move to script directory so all relative paths work
cd "$(dirname "$0")"
. ./arguments.sh
#send a message
echo "Install FusionPBX"
verbose "Installing FusionPBX"
#install dependencies
apt-get install -y --force-yes vim git dbus haveged ssl-cert
apt-get install -y --force-yes ghostscript libtiff5-dev libtiff-tools
if [ $USE_SYSTEM_MASTER = false ]; then
FUSION_MAJOR=$(git ls-remote --heads https://github.com/fusionpbx/fusionpbx.git | cut -d/ -f 3 | grep -P '^\d+\.\d+' | sort | tail -n 1 | cut -d. -f1)
FUSION_MINOR=$(git ls-remote --tags https://github.com/fusionpbx/fusionpbx.git $FUSION_MAJOR.* | cut -d/ -f3 | grep -P '^\d+\.\d+' | sort | tail -n 1 | cut -d. -f2)
FUSION_VERSION=$FUSION_MAJOR.$FUSION_MINOR
verbose "Using version $FUSION_VERSION"
BRANCH="-b $FUSION_VERSION"
else
verbose "Using master"
BRANCH=""
fi
#get the source code
git clone https://github.com/fusionpbx/fusionpbx.git /var/www/fusionpbx
git clone $BRANCH https://github.com/fusionpbx/fusionpbx.git /var/www/fusionpbx
chown -R www-data:www-data /var/www/fusionpbx
chmod -R 755 /var/www/fusionpbx/secure