translation update
[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 '>>> update 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 @task
34 def beta():
35     env.hosts = ['giewont.icm.edu.pl']
36     env.user = 'lektury'
37     env.app_path = '/srv/wolnelektury.pl/beta'
38     env.ve = '/srv/wolnelektury.pl/ve'
39     env.django_root_path = 'src'
40     env.requirements_file = 'requirements/requirements.txt'
41     env.pre_collectstatic = [
42         update_counters,
43     ]
44     env.services = [
45         Supervisord('beta'),
46     ]
47
48
49 @task
50 def staging():
51     env.hosts = ['san.nowoczesnapolska.org.pl:2223']
52     env.user = 'staging'
53     env.app_path = '/home/staging/wolnelektury.pl'
54     env.services = [
55         DebianGunicorn('wolnelektury'),
56     ]