When a user submits "isEditing" inlines and chooses to publish them, publish their...
[phabricator/blender.git] / scripts / install / install_ubuntu.sh
blobab83c3a46cf965b8d64186f16c0d7a11c712961d
1 #!/bin/bash
3 confirm() {
4 echo "Press RETURN to continue, or ^C to cancel.";
5 read -e ignored
8 INSTALL_URI=" https://phurl.io/u/install"
10 failed() {
11 echo
12 echo
13 echo "Installation has failed."
14 echo "Text above this message might be useful to understanding what exactly failed."
15 echo
16 echo "Please follow this guide to manually complete installation:"
17 echo
18 echo $INSTALL_URI
19 echo
20 echo "We apologize for the inconvenience."
21 exit 3
24 ISSUE=`cat /etc/issue`
25 if [[ $ISSUE != Ubuntu* ]]
26 then
27 echo "This script is intended for use on Ubuntu, but this system appears";
28 echo "to be something else. Your results may vary.";
29 echo
30 confirm
33 echo "PHABRICATOR UBUNTU INSTALL SCRIPT";
34 echo "This script will install Apache, Phabricator and its core dependencies.";
35 echo "Run it from the directory you want to install into.";
36 echo
38 echo "Testing sudo..."
39 sudo true
40 if [ $? -ne 0 ]
41 then
42 echo "ERROR: You must be able to sudo to run this script.";
43 exit 1;
44 fi;
46 echo 'Testing Ubuntu version...'
48 VERSION=`lsb_release -rs`
49 MAJOR=`expr match "$VERSION" '\([0-9]*\)'`
51 if [ "$MAJOR" -lt 16 ]
52 then
53 echo 'This script is intented to install on modern operating systems; Your '
54 echo 'operating system is too old for this script.'
55 echo 'You can still install Phabricator manually - please consult the installation'
56 echo 'guide to see how:'
57 echo
58 echo $INSTALL_URI
59 echo
60 exit 2
63 # Ubuntu 16.04 LTS only has php 7.0 in their repos, so they need this extra ppa.
64 # Ubuntu 17.4 and up have official 7.2 builds.
65 if [ "$MAJOR" -eq 16 ]
66 then
67 echo 'This version of Ubuntu requires additional resources in order to install'
68 echo 'and run Phabricator.'
69 echo 'We will now add a the following package repository to your system:'
70 echo ' https://launchpad.net/~ondrej/+archive/ubuntu/php'
71 echo
72 echo 'This repository is generally considered safe to use.'
73 confirm
75 sudo add-apt-repository -y ppa:ondrej/php || failed
78 ROOT=`pwd`
79 echo "Phabricator will be installed to: ${ROOT}.";
80 confirm
82 echo "Installing dependencies: git, apache, mysql, php...";
83 echo
84 sudo apt-get -qq update
85 sudo apt-get install \
86 git mysql-server apache2 libapache2-mod-php \
87 php php-mysql php-gd php-curl php-apcu php-cli php-json php-mbstring \
88 || failed
90 echo "Enabling mod_rewrite in Apache..."
91 echo
92 sudo a2enmod rewrite || failed
94 echo "Downloading Phabricator and dependencies..."
95 echo
96 if [ ! -e libphutil ]
97 then
98 git clone https://github.com/phacility/libphutil.git
99 else
100 (cd libphutil && git pull --rebase)
103 if [ ! -e arcanist ]
104 then
105 git clone https://github.com/phacility/arcanist.git
106 else
107 (cd arcanist && git pull --rebase)
110 if [ ! -e phabricator ]
111 then
112 git clone https://github.com/phacility/phabricator.git
113 else
114 (cd phabricator && git pull --rebase)
117 echo
118 echo
119 echo "Install probably worked mostly correctly. Continue with the 'Configuration Guide':";
120 echo
121 echo " https://secure.phabricator.com/book/phabricator/article/configuration_guide/";
122 echo
123 echo 'Next step is "Configuring Apache webserver".'