From e96c0394f0e162563ce6ae500555f1a5cea632a6 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 31 May 2011 14:14:05 -0700 Subject: [PATCH] Ubuntu install script Summary: Simple script to install dependencies on Ubuntu. There's probably lots of room for improvement here. Test Plan: Imaged a clean Ubuntu box in EC2 and ran this script, it appeared to work? Reviewed By: tuomaspelkonen Reviewers: kevinwallace, jungejason, tuomaspelkonen, aran Commenters: aran CC: moskov, aran, tuomaspelkonen, epriestley Differential Revision: 384 --- scripts/install/install_ubuntu.sh | 83 +++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 scripts/install/install_ubuntu.sh diff --git a/scripts/install/install_ubuntu.sh b/scripts/install/install_ubuntu.sh new file mode 100644 index 0000000000..69463c8039 --- /dev/null +++ b/scripts/install/install_ubuntu.sh @@ -0,0 +1,83 @@ +#!/bin/bash + +confirm() { + echo "Press RETURN to continue, or ^C to cancel."; + read -e ignored +} + +ISSUE=`cat /etc/issue` +if [[ $ISSUE != Ubuntu* ]] +then + echo "This script is intended for use on Ubuntu, but this system appears"; + echo "to be something else. Your results may vary."; + echo + confirm +fi + +echo "PHABRICATOR UBUNTU INSTALL SCRIPT"; +echo "This script will install Phabricator and all of its core dependencies."; +echo "Run it from the directory you want to install into."; +echo + +ROOT=`pwd` +echo "Phabricator will be installed to: ${ROOT}."; +confirm + +echo "Testing sudo..." +sudo true +if [ $? -ne 0 ] +then + echo "ERROR: You must be able to sudo to run this script."; + exit 1; +fi; + +echo "Installing dependencies: git, apache, mysql, php..."; +echo + +set +x + +sudo apt-get -qq update +sudo apt-get install git mysql-server apache2 php5 php5-mysql php5-gd php5-dev php-apc dpkg-dev + +HAVEPCNTL=`php -r "echo extension_loaded('pcntl');"` +if [ $HAVEPCNTL != "1" ] +then + echo "Installing pcntl..."; + echo + apt-get source php5 + PHP5=`ls -1F | grep '^php5-.*/$'` + (cd $PHP5/ext/pcntl && phpize && ./configure && make && sudo make install) +else + echo "pcntl already installed"; +fi + +if [ ! -e libphutil ] +then + git clone git://github.com/facebook/libphutil.git +else + (cd libphutil && git pull --rebase) +fi + +if [ ! -e arcanist ] +then + git clone git://github.com/facebook/arcanist.git +else + (cd arcanist && git pull --rebase) +fi + +if [ ! -e phabricator ] +then + git clone git://github.com/facebook/phabricator.git +else + (cd phabricator && git pull --rebase) +fi + +(cd phabricator && git submodule update --init) + +echo +echo +echo "Install probably worked mostly correctly. Continue with the 'Configuration Guide':"; +echo +echo " http://phabricator.com/docs/phabricator/article/Configuration_Guide.html"; +echo +echo "You can delete any php5-* stuff that's left over in this directory if you want.";