diff --git a/group_vars/constellation_front.yml b/group_vars/constellation_front.yml index fc6c9aac..40b61da7 100644 --- a/group_vars/constellation_front.yml +++ b/group_vars/constellation_front.yml @@ -17,6 +17,10 @@ service_nginx: params: - "alias {% if constellation.version == 'master' %}/var/lib/constellation/media/{% else %}/var/local/constellation/media/{% endif %}" + - filter: "/doc" + params: + - "alias /var/www/constellation-doc/" + - filter: "/" params: - "uwsgi_pass constellation" diff --git a/plays/constellation.yml b/plays/constellation.yml index f323dd6e..4756d8d3 100755 --- a/plays/constellation.yml +++ b/plays/constellation.yml @@ -13,3 +13,4 @@ roles: - nginx - constellation-front + - constellation-doc diff --git a/roles/constellation-doc/tasks/main.yml b/roles/constellation-doc/tasks/main.yml new file mode 100644 index 00000000..8a92c477 --- /dev/null +++ b/roles/constellation-doc/tasks/main.yml @@ -0,0 +1,23 @@ +--- +- name: Install Sphinx and RTD theme + apt: + update_cache: true + install_recommends: false + name: + - python3-sphinx + - python3-sphinx-rtd-theme + register: apt_result + retries: 3 + until: apt_result is succeeded + +- name: Create documentation directory with good permissions + file: + path: /var/www/constellation-doc + state: directory + owner: www-data + group: www-data + mode: u=rwx,g=rwxs,o=rx + +- name: Build HTML documentation + command: "sphinx-build -b dirhtml {{ project_path }}/docs/ /var/www/constellation-doc/" + become_user: www-data