-
Notifications
You must be signed in to change notification settings - Fork 2
/
restart
executable file
·60 lines (60 loc) · 1.55 KB
/
restart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
cd "`dirname $0`"
function refreshDocumentation {
python utilities/document.py
cd docs
make html
cd ..
rm -Rf np/public/docs/*
mkdir -p np/public/docs
mv docs/_build/html/* np/public/docs/
}
if [ "$1" = "docs" ]; then
refreshDocumentation
elif [ "$1" = "ds" ]; then
rm -Rf data *.db
paster setup-app development.ini
paster serve --reload development.ini
elif [ "$1" = "ss" ]; then
kill `cat paster.pid`
git pull
rm -Rf data *.db
paster setup-app production.ini
paster serve --daemon production.ini
crontab deployment/single-server.crt
refreshDocumentation
elif [ "$1" = "cs" ]; then
kill `cat paster.pid`
git pull
rm -Rf data *.db
paster setup-app production.ini
su -c "service rabbitmq-server restart; crontab deployment/cluster-queue.crt"
paster serve --daemon production.ini
kill `ps x |grep consumer.py|grep -v grep|awk '{print $1}'`
crontab deployment/cluster-server.crt
refreshDocumentation
elif [ "$1" = "cp" ]; then
git pull
sftp 134f@october.mech.columbia.edu:/var/www/np/.production.cfg
mv .production.cfg .development.cfg
rm -Rf data *.db
paster setup-app development.ini
crontab deployment/cluster-processor.crt
else
echo
echo "Refresh documentation"
echo "$0 docs"
echo
echo "Restart development server"
echo "$0 ds"
echo
echo "Restart single server"
echo "$0 ss"
echo
echo "Restart cluster server"
echo "$0 cs"
echo
echo "Restart cluster processor"
echo "$0 cp"
echo
fi