-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfabfile.py
66 lines (44 loc) · 1.2 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from fabric.api import *
env.hosts = ['v2v',]
env.use_ssh_config = True
@task
def pull():
with cd('~/webapps/django_gu/v2v'):
run('git pull')
@task
def build_static():
run('django-admin.py collectstatic --noinput')
with cd('~/webapps/django_gu/v2v/vacant_to_vibrant/collected_static/js/'):
run('r.js -o app.build.js')
@task
def install_requirements():
with cd('~/webapps/django_gu/v2v'):
run('pip install -r requirements/base.txt')
run('pip install -r requirements/production.txt')
@task
def syncdb():
run('django-admin.py syncdb')
@task
def migrate():
run('django-admin.py migrate')
@task
def restart_django():
run('supervisorctl -c ~/supervisor/supervisord.conf restart django')
@task
def restart_tilestache():
run('bash ~/scripts/tiles/clean.sh')
run('supervisorctl -c ~/supervisor/supervisord.conf restart tiles')
@task
def restart_memcached():
run('supervisorctl -c ~/supervisor/supervisord.conf restart memcached')
@task
def status():
run('supervisorctl -c ~/supervisor/supervisord.conf status')
@task
def deploy():
pull()
install_requirements()
syncdb()
migrate()
build_static()
restart_django()