Page MenuHomePhabricator
Paste P1726

Phabricator upgrade script
ActivePublic

Authored by cspeckmim on Feb 19 2015, 7:28 PM.
Tags
None
Referenced Files
F309914: Phabricator_upgrade_script
Feb 19 2015, 7:28 PM
Subscribers
None
#!/bin/sh
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
set -e
set -x
# set the environment for where the phabricator repos exist (installed)
ROOT=/usr/local/phacility
PHAB_USER=phabricator
PHAB_PHD_USER=phab-phd
### UPDATE WORKING COPIES ######################################################
cd $ROOT/libphutil
sudo -u $PHAB_USER git pull -n
cd $ROOT/arcanist
sudo -u $PHAB_USER git pull -n
cd $ROOT/phabricator
sudo -u $PHAB_USER git pull -n
### CYCLE WEB SERVER AND DAEMONS ###############################################
# daemons (phd), notification service (aphlict), web service (nginx), php cgi/gateway (php-fpm)
systemctl stop sshd-phab.service
sudo -u $PHAB_PHD_USER $ROOT/phabricator/bin/phd stop
sudo -u $PHAB_USER $ROOT/phabricator/bin/aphlict stop
systemctl stop nginx.service
systemctl stop php-fpm.service
# upgrade database
sudo -u $PHAB_USER $ROOT/phabricator/bin/storage upgrade --force
systemctl start php-fpm.service
systemctl start nginx.service
sudo -u $PHAB_PHD_USER $ROOT/phabricator/bin/phd start
sudo -u $PHAB_USER $ROOT/phabricator/bin/aphlict start
systemctl start sshd-phab.service

Event Timeline

cspeckmim changed the title of this paste from untitled to Phabricator upgrade script.
cspeckmim updated the paste's language from autodetect to autodetect.