-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfabfile.py
58 lines (38 loc) · 1.05 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
from fabric.api import *
env.hosts = ['llphilly',]
env.use_ssh_config = True
@task
def pull():
with cd('~/webapps/django_gu/livinglots-philly'):
run('git pull')
@task
def build_static():
run('django-admin.py collectstatic --noinput')
@task
def install_requirements():
with cd('~/webapps/django_gu/livinglots-philly'):
run('pip install -r requirements/base.txt')
#run('pip install -r requirements/production.txt')
@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()
migrate()
build_static()
restart_django()