|
| 1 | +#!/bin/sh |
| 2 | + |
| 3 | +set -e |
| 4 | +set -x |
| 5 | + |
| 6 | +# This is an example script for updating Phabricator, similar to the one used to |
| 7 | +# update <https://secure.phabricator.com/>. It might not work perfectly on your |
| 8 | +# system, but hopefully it should be easy to adapt. |
| 9 | + |
| 10 | +# NOTE: This script assumes you are running it from a directory which contains |
| 11 | +# arcanist/, libphutil/, phabricator/, and possibly diviner/. |
| 12 | + |
| 13 | +ROOT=`pwd` # You can hard-code the path here instead. |
| 14 | + |
| 15 | + |
| 16 | +### UPDATE WORKING COPIES ###################################################### |
| 17 | + |
| 18 | +if [ -e $ROOT/diviner ] |
| 19 | +then |
| 20 | + (cd $ROOT/diviner && git pull) |
| 21 | +fi |
| 22 | + |
| 23 | +(cd $ROOT/libphutil && git pull) |
| 24 | +(cd $ROOT/arcanist && git pull) |
| 25 | +(cd $ROOT/phabricator && git pull && git submodule update --init) |
| 26 | + |
| 27 | + |
| 28 | +### GENERATE DOCUMENTATION ##################################################### |
| 29 | + |
| 30 | +# This generates documentation if you have diviner/ checked out. You generally |
| 31 | +# don't need to do this unless you're contributing to Phabricator and want to |
| 32 | +# preview some of the amazing documentation you've just written. |
| 33 | +if [ -e $ROOT/diviner ] |
| 34 | +then |
| 35 | + (cd $ROOT/diviner && $ROOT/diviner/bin/diviner .) |
| 36 | + (cd $ROOT/libphutil && $ROOT/diviner/bin/diviner .) |
| 37 | + (cd $ROOT/arcanist && $ROOT/diviner/bin/diviner .) |
| 38 | + (cd $ROOT/phabricator && $ROOT/diviner/bin/diviner .) |
| 39 | +fi |
| 40 | + |
| 41 | +### CYCLE APACHE AND DAEMONS ################################################### |
| 42 | + |
| 43 | +# Stop Apache. Depening on what system you're running, you may need to use |
| 44 | +# 'apachectl' or something else to cycle apache. |
| 45 | +sudo /etc/init.d/httpd stop |
| 46 | + |
| 47 | +# Stop daemons. |
| 48 | +$ROOT/phabricator/bin/phd stop |
| 49 | + |
| 50 | +# Upgrade the database schema. |
| 51 | +$ROOT/phabricator/scripts/sql/upgrade_schema.php -f |
| 52 | + |
| 53 | +# Restart apache. |
| 54 | +sudo /etc/init.d/httpd start |
| 55 | + |
| 56 | +# Restart daemons. Customize this to start whatever daemons you're running on |
| 57 | +# your system. |
| 58 | + |
| 59 | +# $ROOT/phabricator/bin/phd repository-launch-master |
| 60 | +# $ROOT/phabricator/bin/phd launch metamta |
| 61 | +# $ROOT/phabricator/bin/phd launch 4 taskmaster |
| 62 | +# $ROOT/phabricator/bin/phd launch ircbot /config/bot.json |
0 commit comments