forked from dellsystem/mcmun-2013
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfabfile.py
executable file
·38 lines (29 loc) · 1.1 KB
/
fabfile.py
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
from fabric.api import local, run, env, settings
env.hosts = ['[email protected]']
def less():
local("lessc mcmun/static/css/mcmun.less -x > mcmun/static/css/mcmun.css")
def deploy():
less()
with settings(warn_only=True):
local("git add mcmun/static/css/mcmun.css")
local("git commit -m 'Update compiled CSS'")
local('git push')
run('cd mcmun.org && git pull origin master')
run('python mcmun.org/manage.py collectstatic --noinput')
run('python mcmun.org/manage.py syncdb')
# Kill the process and start it again
run('touch ~/mcmun.org/tmp/restart.txt && pkill python')
def up():
local("python manage.py runserver")
def dump():
local("python manage.py dumpdata cms --indent=4 > cms/fixtures/initial_data.json")
local("python manage.py dumpdata committees --indent=4 > committees/fixtures/initial_data.json")
def reset():
local("rm db.sqlite")
local("python manage.py syncdb")
def restart():
local("sudo kill -HUP `cat /srv/ssuns.mcmun.org/gunicorn.pid`")
def nginx():
local("sudo kill -HUP `cat /var/run/nginx.pid`")
def static():
local("python manage.py collectstatic --noinput")