correct sorting by author in lists: collection, audiobooks
[wolnelektury.git] / fabfile.py
1 # -*- coding: utf-8 -*-
2 from fnpdeploy import *
3
4 try:
5     from fabfile_local import *
6 except ImportError:
7     pass
8
9
10 env.project_name = 'wolnelektury'
11
12
13 @task
14 def production():
15     env.hosts = ['giewont.icm.edu.pl']
16     env.user = 'lektury'
17     env.app_path = '/srv/wolnelektury.pl'
18     env.django_root_path = 'src'
19     env.requirements_file = 'requirements/requirements.txt'
20     env.services = [
21         Supervisord('wolnelektury'),
22         Supervisord('wolnelektury.celery'),
23     ]
24
25
26 def update_counters():
27     print '>>> updating counters'
28     require('app_path', 'project_name')
29     with cd(get_django_root_path('current')):
30         run('%(ve)s/bin/python manage.py update_counters' % env, pty=True)
31
32
33 def compile_messages():
34     print '>>> compiling messages'
35     require('app_path', 'project_name')
36     with cd(get_django_root_path('current')):
37         run('%(ve)s/bin/python manage.py localepack -c' % env, pty=True)
38
39
40 @task
41 def beta():
42     env.hosts = ['giewont.icm.edu.pl']
43     env.user = 'lektury'
44     env.app_path = '/srv/wolnelektury.pl/beta'
45     env.ve = '/srv/wolnelektury.pl/ve'
46     env.django_root_path = 'src'
47     env.requirements_file = 'requirements/requirements.txt'
48     env.pre_collectstatic = [
49         update_counters,
50         compile_messages,
51     ]
52     env.services = [
53         Supervisord('beta'),
54     ]
55
56
57 @task
58 def staging():
59     env.hosts = ['san.nowoczesnapolska.org.pl:2223']
60     env.user = 'staging'
61     env.app_path = '/home/staging/wolnelektury.pl'
62     env.services = [
63         DebianGunicorn('wolnelektury'),
64     ]