new tasks in fab production
authorJan Szejko <j-sz@o2.pl>
Mon, 1 Feb 2016 09:33:24 +0000 (10:33 +0100)
committerJan Szejko <j-sz@o2.pl>
Mon, 1 Feb 2016 09:33:24 +0000 (10:33 +0100)
fabfile.py

index a9e621d..ff9a4b4 100644 (file)
@@ -10,19 +10,6 @@ except ImportError:
 env.project_name = 'wolnelektury'
 
 
-@task
-def production():
-    env.hosts = ['giewont.icm.edu.pl']
-    env.user = 'lektury'
-    env.app_path = '/srv/wolnelektury.pl'
-    env.django_root_path = 'src'
-    env.requirements_file = 'requirements/requirements.txt'
-    env.services = [
-        Supervisord('wolnelektury'),
-        Supervisord('wolnelektury.celery'),
-    ]
-
-
 def update_counters():
     print '>>> updating counters'
     require('app_path', 'project_name')
@@ -37,6 +24,23 @@ def compile_messages():
         run('source %(ve)s/bin/activate && python manage.py localepack -c' % env, pty=True)
 
 
+@task
+def production():
+    env.hosts = ['giewont.icm.edu.pl']
+    env.user = 'lektury'
+    env.app_path = '/srv/wolnelektury.pl'
+    env.django_root_path = 'src'
+    env.requirements_file = 'requirements/requirements.txt'
+    env.pre_collectstatic = [
+        update_counters,
+        compile_messages,
+    ]
+    env.services = [
+        Supervisord('wolnelektury'),
+        Supervisord('wolnelektury.celery'),
+    ]
+
+
 @task
 def beta():
     env.hosts = ['giewont.icm.edu.pl']