1 # -*- coding: utf-8 -*-
 
   2 from fnpdeploy import *
 
   5     from fabfile_local import *
 
  10 env.project_name = 'wolnelektury'
 
  13 class ManageTask(Task):
 
  14     def __init__(self, name, params='', **kwargs):
 
  15         super(ManageTask, self).__init__(**kwargs)
 
  20         require('app_path', 'project_name')
 
  21         with cd(get_django_root_path('current')):
 
  22             run('source %(ve)s/bin/activate && python manage.py %(task)s %(params)s' % {
 
  25                 'params': self.params,
 
  29 class Memcached(Service):
 
  31         print '>>> memcached: restart'
 
  32         sudo('service memcached restart', shell=False)
 
  37     env.hosts = ['giewont.icm.edu.pl']
 
  39     env.app_path = '/srv/wolnelektury.pl'
 
  40     env.django_root_path = 'src'
 
  41     env.requirements_file = 'requirements/requirements.txt'
 
  42     env.pre_collectstatic = [
 
  43         ManageTask('update_counters'),
 
  44         ManageTask('localepack', '-c'),
 
  47         Supervisord('wolnelektury'),
 
  48         Supervisord('wolnelektury.celery'),
 
  55     env.hosts = ['giewont.icm.edu.pl']
 
  57     env.app_path = '/srv/wolnelektury.pl/beta'
 
  58     env.ve = '/srv/wolnelektury.pl/ve'
 
  59     env.django_root_path = 'src'
 
  60     env.requirements_file = 'requirements/requirements.txt'
 
  61     env.pre_collectstatic = [
 
  62         ManageTask('update_counters'),
 
  63         ManageTask('localepack', '-c'),
 
  72     env.hosts = ['san.nowoczesnapolska.org.pl:2223']
 
  74     env.app_path = '/home/staging/wolnelektury.pl'
 
  76         DebianGunicorn('wolnelektury'),