Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F4001913
phabricatorctl
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Jul 9, 6:54 AM
Size
2 KB
Mime Type
text/x-shellscript
Expires
Sat, Jul 11, 6:54 AM (1 d, 2 h)
Engine
blob
Format
Raw Data
Handle
273491
Attached To
rXR Xreate
phabricatorctl
View Options
#!/bin/bash
#os: ubuntu bionic
#REMOTE=xreate@xreate.org
REMOTE='xreate@xreate.bigserver'
PHP=php
PHP_FPM=php7.2-fpm
set -x
Filename=`realpath $0`
Dir=`dirname $Filename`
upload () {
DIR_UPLOAD=$Dir
rsync -e 'ssh -p24' -rtvz $DIR_UPLOAD/* $REMOTE:/opt/
}
refmap () {
./phabricator/bin/celerity map
cd arcanist/ && ./bin/arc liberate && cd ..
$PHP ./libphutil/scripts/phutil_rebuild_map.php libphutil/src/
}
init () {
ln -s ../../../../phab-xreate/css ./phabricator/webroot/rsrc/css/xreate
refmap
}
stop () {
echo Stop services
sudo /opt/phabricator/bin/phd stop --force
sudo systemctl stop $PHP_FPM
sudo systemctl stop nginx
}
start () {
echo "Start services"
sudo /opt/phabricator/bin/phd start
sudo systemctl start $PHP_FPM
sudo systemctl start nginx
}
upgrade () {
echo "Upgrade phabricator core"
cd /opt/phabricator
git pull
echo "Upgrade arcanist"
cd /opt/arcanist
git pull
echo "Upgrade libphutil"
cd /opt/libphutil
git pull
echo "Upgrade Phab-Xreate"
cd /opt/phab-xreate
git pull
echo "Upgrade storage"
/opt/phabricator/bin/storage upgrade --force;
}
apply_patches () {
cd ./patches
git pull
echo "Apply phabricator patches"
cd ../phabricator
git checkout -- *
git apply ../patches/patch-phabricator
echo "Apply libphutil patches"
cd ../libphutil
git checkout -- *
git apply ../patches/patch-libphutil
}
start_sshd () {
sudo /usr/sbin/sshd -f /etc/ssh/sshd_config_phabricator
}
dump () {
./phabricator/bin/storage dump --compress --output $1
}
dump_restore () {
gunzip -c $1 | mysql -uroot
}
dump_repo () {
tar -C $2 -zcf $1 ./
}
reset_account () {
./phabricator/bin/auth recover pgess
}
case $1 in
first-start) start && start_sshd;;
start) start;;
stop) stop;;
restart) stop && start;;
upgrade) stop && upgrade;;
patch) stop && apply_patches && start;;
upload) upload;;
init) init;;
refmap) refmap;;
dump) dump $2;;
dump-restore) dump_restore $2;;
dump-repo) dump_repo $2 $3;;
*) echo "usage: $0 first-start | start | stop | restart | upgrade | patch | upload | init | refmap | dump <FILE> | dump-restore <dump-file> | dump-repo <Arch> <Repo>";;
esac
Event Timeline
Log In to Comment