-
Notifications
You must be signed in to change notification settings - Fork 2
/
bash
48 lines (47 loc) · 1.27 KB
/
bash
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
Barracuda=/root/barracuda
Venv=/root/BaEnv
Port=`grep -oE "[0-9]+" $Barracuda/nginx`
function ba_create_venv ()
{
echo +++++++++++++++++++++PIP+++++++++++++++++++++++++++;
echo +++++++++++++++++++++++++++++++++++++++++++++++++++;
[ -d $Venv ] || virtualenv --no-site-packages $Venv;
$Venv/bin/pip install -r $Barracuda/pip-requirements-deploy.txt;
return $?
}
function ba_get_from_github ()
{
echo +++++++++++++++++++++GIT+++++++++++++++++++++++++++;
echo +++++++++++++++++++++++++++++++++++++++++++++++++++;
[ -d $Barracuda ] && ( cd $Barracuda;
git pull ) || git clone git://github.com/kshileev/barracuda.git $Barracuda;
return $?
}
function ba_init ()
{
ba_get_from_github || return;
ba_create_venv || return;
. $Venv/bin/activate;
ba_manage syncdb
}
function ba_manage ()
{
[ -f $Barracuda/manage.py ] || ( echo no barracude- run binit!;
return );
[ -f $Venv/bin/python ] || ( echo no BarEnv- run binit!;
return );
$Venv/bin/python $Barracuda/manage.py $@
}
function ba_reset ()
{
rm -i -rf $Barracuda $Venv;
ba_init
}
function ba_run ()
{
ba_manage runfcgi host=127.0.0.1 port=$Port daemonize=true
}
function ba_debug ()
{
ba_manage runfcgi host=127.0.0.1 port=$Port daemonize=false
}