fix locale compilation, use variables for paths
- install gettext - define and use variables checkout, home and appdir
This commit is contained in:
parent
f5f373ec76
commit
a6e795684f
1 changed files with 14 additions and 11 deletions
|
@ -9,10 +9,14 @@ gnuviechadmin-packages:
|
|||
- python-virtualenv
|
||||
- python-dev
|
||||
- python-pip
|
||||
- gettext
|
||||
|
||||
{% import "webserver/sslcert.macros.sls" as sslcert %}
|
||||
|
||||
{% set venv = salt['pillar.get']('gnuviechadmin:virtualenv') %}
|
||||
{% set checkout = '/vagrant' %}
|
||||
{% set home = '/home/vagrant' %}
|
||||
{% set appdir = checkout + '/gnuviechadmin' %}
|
||||
{% set domainname = salt['pillar.get']('gnuviechadmin:domainname') %}
|
||||
{{ sslcert.key_cert(domainname) }}
|
||||
|
||||
|
@ -23,7 +27,7 @@ gnuviechadmin-packages:
|
|||
- require:
|
||||
- cmd: gnuviechadmin-venv
|
||||
|
||||
/home/vagrant/gvasettings.sh:
|
||||
{{ home }}/gvasettings.sh:
|
||||
file.managed:
|
||||
- user: vagrant
|
||||
- group: vagrant
|
||||
|
@ -45,31 +49,32 @@ gnuviechadmin-requires:
|
|||
- name: {{ venv }}/bin/pip install -U -r requirements/local.txt && touch {{ venv }}/lastinstall
|
||||
- user: vagrant
|
||||
- group: vagrant
|
||||
- cwd: /vagrant
|
||||
- cwd: {{ checkout }}
|
||||
- require:
|
||||
- file: {{ venv }}
|
||||
- pkg: python-dev
|
||||
- pkg: libpq-dev
|
||||
- unless: test -e {{ venv }}/lastinstall && test /vagrant/requirements/local.txt -ot {{ venv }}/lastinstall && test /vagrant/requirements/base.txt -ot {{ venv }}/lastinstall
|
||||
- unless: test -e {{ venv }}/lastinstall && test {{ checkout }}/requirements/local.txt -ot {{ venv }}/lastinstall && test {{ checkout }}/requirements/base.txt -ot {{ venv }}/lastinstall
|
||||
|
||||
gnuviechadmin-dbschema:
|
||||
cmd.wait:
|
||||
- name: . /home/vagrant/gvasettings.sh ; {{ venv }}/bin/python manage.py migrate --noinput
|
||||
- name: . {{ home }}/gvasettings.sh ; unset LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME ; {{ venv }}/bin/python manage.py migrate --noinput
|
||||
- user: vagrant
|
||||
- group: vagrant
|
||||
- cwd: /vagrant/gnuviechadmin
|
||||
- cwd: {{ appdir }}
|
||||
- watch:
|
||||
- cmd: gnuviechadmin-requires
|
||||
- file: /home/vagrant/gvasettings.sh
|
||||
- file: {{ home }}/gvasettings.sh
|
||||
|
||||
gnuviechadmin-locale-data-compile:
|
||||
cmd.wait:
|
||||
- name: . /home/vagrant/gvasettings.sh ; find /vagrant/gnuviechadmin -type d -name 'locale' | while read dir; do cd $(dirname "$dir") ; {{ venv }}/bin/python /vagrant/gnuviechadmin/manage.py compilemessages ; done
|
||||
- name: . {{ home }}/gvasettings.sh ; find {{ appdir }} -type d -name 'locale' | while read dir; do cd $(dirname "$dir") ; {{ venv }}/bin/python {{ appdir }}/manage.py compilemessages ; done
|
||||
- user: vagrant
|
||||
- group: vagrant
|
||||
- cwd: /vagrant/gnuviechadmin
|
||||
- cwd: {{ appdir }}
|
||||
- require:
|
||||
- file: /home/vagrant/gvasettings.sh
|
||||
- pkg: gettext
|
||||
- file: {{ home }}/gvasettings.sh
|
||||
- file: {{ venv }}
|
||||
|
||||
/etc/nginx/sites-available/{{ domainname }}:
|
||||
|
@ -85,8 +90,6 @@ gnuviechadmin-locale-data-compile:
|
|||
ssl_certdir: {{ salt['pillar.get']('nginx:sslcertdir', '/etc/nginx/ssl/certs') }}
|
||||
- require:
|
||||
- pkg: nginx
|
||||
- watch_in:
|
||||
- service: nginx
|
||||
|
||||
/etc/nginx/sites-enabled/{{ domainname }}:
|
||||
file.symlink:
|
||||
|
|
Loading…
Reference in a new issue