Changeset View
Changeset View
Standalone View
Standalone View
scripts/install/install_rhel-derivs.sh
#!/bin/bash | #!/bin/bash | ||||
confirm() { | confirm() { | ||||
echo "Press RETURN to continue, or ^C to cancel."; | echo "Press RETURN to continue, or ^C to cancel."; | ||||
read -e ignored | read -e ignored | ||||
} | } | ||||
RHEL_VER_FILE="/etc/redhat-release" | RHEL_VER_FILE="/etc/redhat-release" | ||||
INSTALL_URI=" https://we.phorge.it/book/phorge/article/installation_guide/" | |||||
CONFIG_URI=" https://we.phorge.it/book/phorge/article/configuration_guide/" | |||||
REPOSITORY_URI="https://we.phorge.it/source" | |||||
NAME_MAIN="phorge" | |||||
NAME_ARC="arcanist" | |||||
if [[ ! -f $RHEL_VER_FILE ]] | if [[ ! -f $RHEL_VER_FILE ]] | ||||
then | then | ||||
echo "It looks like you're not running a Red Hat-derived distribution." | echo "It looks like you're not running a Red Hat-derived distribution." | ||||
echo "This script is intended to install Phabricator on RHEL-derived" | echo "This script is intended to install $NAME_MAIN on RHEL-derived" | ||||
echo "distributions such as RHEL, Fedora, CentOS, and Scientific Linux." | echo "distributions such as RHEL, Fedora, CentOS, and Scientific Linux." | ||||
echo "Proceed with caution." | echo "Proceed with caution." | ||||
confirm | confirm | ||||
fi | fi | ||||
echo "PHABRICATOR RED HAT DERIVATIVE INSTALLATION SCRIPT"; | echo "$NAME_MAIN RED HAT DERIVATIVE INSTALLATION SCRIPT"; | ||||
echo "This script will install Phabricator and all of its core dependencies."; | echo "This script will install $NAME_MAIN and all of its core dependencies."; | ||||
echo "Run it from the directory you want to install into."; | echo "Run it from the directory you want to install into."; | ||||
echo | echo | ||||
RHEL_REGEX="release ([0-9]+)\." | RHEL_REGEX="release ([0-9]+)\." | ||||
if [[ $(cat $RHEL_VER_FILE) =~ $RHEL_REGEX ]] | if [[ $(cat $RHEL_VER_FILE) =~ $RHEL_REGEX ]] | ||||
then | then | ||||
RHEL_MAJOR_VER=${BASH_REMATCH[1]} | RHEL_MAJOR_VER=${BASH_REMATCH[1]} | ||||
Show All 9 Lines | then | ||||
echo "** WARNING **" | echo "** WARNING **" | ||||
echo "A major version less than 6 was detected. Because of this," | echo "A major version less than 6 was detected. Because of this," | ||||
echo "several needed dependencies are not available via default repos." | echo "several needed dependencies are not available via default repos." | ||||
echo "Specifically, RHEL 5 does not have a PEAR package for php53-*." | echo "Specifically, RHEL 5 does not have a PEAR package for php53-*." | ||||
echo "We will attempt to install it manually, for APC. Please be careful." | echo "We will attempt to install it manually, for APC. Please be careful." | ||||
confirm | confirm | ||||
fi | fi | ||||
echo "Phabricator will be installed to: $(pwd)."; | echo "$NAME_MAIN will be installed to: $(pwd)."; | ||||
confirm | confirm | ||||
echo "Testing sudo/root..." | echo "Testing sudo/root..." | ||||
if [[ $EUID -ne 0 ]] # Check if we're root. If we are, continue. | if [[ $EUID -ne 0 ]] # Check if we're root. If we are, continue. | ||||
then | then | ||||
sudo true | sudo true | ||||
SUDO="sudo" | SUDO="sudo" | ||||
if [[ $? -ne 0 ]] | if [[ $? -ne 0 ]] | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
pidof mysqld 2>&1 > /dev/null | pidof mysqld 2>&1 > /dev/null | ||||
if [[ $? -ne 0 ]] | if [[ $? -ne 0 ]] | ||||
then | then | ||||
echo "Please remember to start the mysql server: /etc/init.d/mysqld start" | echo "Please remember to start the mysql server: /etc/init.d/mysqld start" | ||||
fi | fi | ||||
confirm | confirm | ||||
if [[ ! -e arcanist ]] | if [[ ! -e "$NAME_ARC" ]] | ||||
then | then | ||||
git clone https://github.com/phacility/arcanist.git | git clone "$REPOSITORY_URI/$NAME_ARC.git" | ||||
else | else | ||||
(cd arcanist && git pull --rebase) | (cd "$NAME_ARC" && git pull --rebase) | ||||
fi | fi | ||||
if [[ ! -e phabricator ]] | if [[ ! -e "$NAME_MAIN" ]] | ||||
then | then | ||||
git clone https://github.com/phacility/phabricator.git | git clone "$REPOSITORY_URI/$NAME_MAIN.git" | ||||
else | else | ||||
(cd phabricator && git pull --rebase) | (cd "$NAME_MAIN" && git pull --rebase) | ||||
fi | fi | ||||
echo | echo | ||||
echo | echo | ||||
echo "Install probably worked mostly correctly. Continue with the 'Configuration Guide':"; | echo "Install probably worked mostly correctly. Continue with the 'Configuration Guide':"; | ||||
echo | echo | ||||
echo " https://secure.phabricator.com/book/phabricator/article/configuration_guide/"; | echo $CONFIG_URI |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0