install and deploy multi-tenant chrono (#22918)

This commit is contained in:
Thomas NOËL 2018-03-30 10:44:24 +02:00
parent 029b4e066f
commit 2984c662c7
7 changed files with 60 additions and 0 deletions

View File

@ -9,6 +9,7 @@
- wcs
- passerelle
- fargo
- chrono
- hobo-agent
- end
vars:

View File

@ -43,6 +43,12 @@ local:
nginx_host_pattern: '~^(.*)\-fargo\.local\.publik$'
project_name: fargo
server_port: 8036
chrono:
db_name: chrono
host_pattern: "*-chrono.local.publik"
nginx_host_pattern: '~^(.*)\-chrono\.local\.publik$'
project_name: chrono
server_port: 8040
wcs:
db_name: wcs
host_pattern: "*-wcs.local.publik"
@ -57,3 +63,4 @@ local:
demarches-wcs: "demarches-wcs.local.publik"
dev-passerelle: "dev-passerelle.local.publik"
dev-fargo: "dev-fargo.local.publik"
dev-chrono: "dev-chrono.local.publik"

View File

@ -0,0 +1,11 @@
{% extends "app-settings-base.j2" %}
{% block app_custom_before %}
# SAML2 authentication
INSTALLED_APPS += ('mellon',)
{% endblock %}
{% block app_custom_after %}
# disable django-mellon autologin
MELLON_OPENED_SESSION_COOKIE_NAME = None
{% endblock %}

View File

@ -0,0 +1,14 @@
- name: source install chrono
import_tasks: install_source.yml
vars:
repo: "chrono"
repo_dir: "{{ src_dir }}/chrono"
- name: chrono app setup
import_role:
name: app-setup
- name: chrono nginx setup
import_role:
name: nginx-setup

View File

@ -0,0 +1,11 @@
app_name: chrono
compile_scss: false
compile_translations: true
migrate_schemas: true
db_name: "{{apps['chrono']['db_name']}}"
manage_cmd: "{{venv_python}} {{src_dir}}/chrono/manage.py"
nginx_host_pattern: "{{apps['chrono']['nginx_host_pattern']}}"
nginx_template_name: "chrono-nginx-server.j2"
project_name: "{{apps['chrono']['project_name']}}"
server_port: "{{apps['chrono']['server_port']}}"
settings_env_var: CHRONO_SETTINGS_FILE

View File

@ -42,6 +42,10 @@
"url": "https://{{tenants_conf['dev-fargo']}}/",
"title": "Porte-documents"
}},
{"create-chrono": {
"url": "https://{{tenants_conf['dev-chrono']}}/",
"title": "Agendas"
}},
{"set-theme": {
"theme": "publik"
}}

View File

@ -0,0 +1,12 @@
{% extends "base-nginx-server.j2" %}
{% block middle %}
location ~ ^/static/(.+)$ {
root /;
try_files /var/lib/{{project_name}}/tenants/$host/static/$1
/var/lib/{{project_name}}/tenants/$host/theme/static/$1
/var/lib/{{project_name}}/collectstatic/$1
=404;
add_header Access-Control-Allow-Origin *;
}
{% endblock %}