Commits

Dmitri Lebedev  committed 952d515

split buildout into dev & prod configs

  • Participants
  • Parent commits 7ac20a0

Comments (0)

Files changed (6)

 werkzeug: bin/django syncdb
 	./bin/django runserver_plus
 
+# requires uWSGI >= 1.2
+.PHONY: nginx
+nginx: bin/django syncdb
+	uwsgi --ini deploy/uwsgi.ini --py-autoreload=3
+
 .PHONY: shell_plus
 shell_plus: bin/django syncdb
 	./bin/django shell_plus
 syncdb: bin/django
 	./bin/django syncdb --noinput && touch syncdb
 
+project/locale:
+	mkdir project/locale
+
 .PHONY: make_trans
-make_trans: bin/django
-	./bin/django makemessages -a -e 'py,html,haml'
+trans: bin/django project/locale
+	find project -name '*.haml_trans' -delete
+	find project -name '*.haml' -exec bin/hamlpy {} {}_trans \;
+	./bin/django makemessages -a -e 'py,html,haml_trans,txt' -i 'django-payokay' -i docs -i django-guardian
+	./bin/django makemessages -d djangojs -a -i project/static/CACHE
+	find project -name '*.haml_trans' -delete
+
+compile_trans:
+	find project/locale/ -mindepth 1 -maxdepth 1 -type d -exec make {}/LC_MESSAGES/django.mo {}/LC_MESSAGES/djangojs.mo \;
+
+project/locale/%/LC_MESSAGES/django.mo: project/locale/%/LC_MESSAGES/django.po bin/django
+	./bin/django compilemessages -l $(word 2,$(subst /, ,$@))
+
+project/locale/%/LC_MESSAGES/djangojs.mo: project/locale/%/LC_MESSAGES/djangojs.po bin/django
+	./bin/django compilemessages -l $(word 2,$(subst /, ,$@))
+
+
+project/locale/*/LC_MESSAGES/django.po project/locale/*/LC_MESSAGES/djangojs.po:
 
 buildout.cfg:
 
-compile_trans:
-	find locale/ -mindepth 1 -maxdepth 1 -type d -exec make {}/LC_MESSAGES/django.mo \;
-
-locale/%/LC_MESSAGES/django.mo: locale/%/LC_MESSAGES/django.po bin/django
-	./bin/django compilemessages -l $(word 2,$(subst /, ,$@))
-
-locale/*/LC_MESSAGES/django.po:
-
 # coffeescript dependency. Uncomment the following line to turn it on.
 # requires curl
 # Also set USE_COFFEE_SCRIPT=True in settings.py

File buildout.cfg

+buildout.dev.cfg

File buildout.common.cfg

 [buildout]
 # add local subrepos that have setup.py to develop eggs in 'develop =' section.
 # gp.recipe.node works only from the repo, not from pypi
-develop = 
+develop =
 role = dev
 
 domain = localhost
 	django
 	cleanup
 	sass
-	yuic
+	yuic_hamlpy
+
 
 project = project
 eggs =
 	lxml 						# required by compressor
 #	versiontools 				# required by reversion
 	hamlpy 						# HAML templates
-	djaml 						# hamlpy loader
 
 
 [sass]
 	find ${buildout:project} -name '*.py[co]' -delete
 
 
-[yuic]
+[yuic_hamlpy]
 # YUI compressor. Minifies JS files.
 recipe = zc.recipe.egg
-eggs = yuicompressor
+eggs =
+	yuicompressor
+	hamlpy
+scripts =
+	hamlpy
+	yuicompressor
 
 
 [uwsgi]
 # or a unix socket for slightly better performance
 
 input = deploy/uwsgi.ini.tpl
-output = deploy/uwsgi_${buildout:role}.ini
+output = deploy/uwsgi.ini
 
 [nginx]
 <= uwsgi

File buildout.dev.cfg

 [buildout]
 extends = buildout.common.cfg
 role = dev
-parts =
-	django
-	cleanup
-	sass
-	yuic
+
+#parts +=
 #	nginx
 #	uwsgi
-# uncomment these if you need to run nginx/uwsgi in dev environment
 
 
 eggs +=

File buildout.prod.cfg

 extends = buildout.common.cfg
 role = prod
 
+parts +=
+	nginx
+	uwsgi

File locale/_nothing_

Empty file removed.