mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-11-04 01:12:08 +01:00 
			
		
		
		
	Ansible builds and deploys the documentation
This commit is contained in:
		@@ -1,8 +1,36 @@
 | 
			
		||||
# the upstream component nginx needs to connect to
 | 
			
		||||
upstream note{
 | 
			
		||||
upstream note {
 | 
			
		||||
    server unix:///var/www/note_kfet/note_kfet.sock; # file socket
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
{% if note.doc_enabled %}
 | 
			
		||||
# Redirect doc HTTP to doc HTTPS
 | 
			
		||||
server {
 | 
			
		||||
    listen 80;
 | 
			
		||||
    listen [::]:80;
 | 
			
		||||
    server_name {{ note.doc_url }};
 | 
			
		||||
 | 
			
		||||
    location / {
 | 
			
		||||
        return 301 https://{{ note.doc_url }}$request_uri;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# configuration of the documentation website
 | 
			
		||||
server {
 | 
			
		||||
    listen 443 ssl;
 | 
			
		||||
    listen [::]:443 ssl;
 | 
			
		||||
 | 
			
		||||
    server_name {{ note.doc_url }};
 | 
			
		||||
    root /var/www/documentation;
 | 
			
		||||
    charset     utf-8;
 | 
			
		||||
 | 
			
		||||
    ssl_certificate /etc/letsencrypt/live/{{ note.server_name }}/fullchain.pem;
 | 
			
		||||
    ssl_certificate_key /etc/letsencrypt/live/{{ note.server_name }}/privkey.pem;
 | 
			
		||||
    include /etc/letsencrypt/options-ssl-nginx.conf;
 | 
			
		||||
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
 | 
			
		||||
}
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
# Redirect HTTP to nk20 HTTPS
 | 
			
		||||
server {
 | 
			
		||||
    listen 80 default_server;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										20
									
								
								ansible/roles/8-docs/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								ansible/roles/8-docs/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
---
 | 
			
		||||
- name: Install Sphinx and RTD theme
 | 
			
		||||
  pip:
 | 
			
		||||
    requirements: /var/www/note_kfet/docs/requirements.txt
 | 
			
		||||
    virtualenv: /var/www/note_kfet/env
 | 
			
		||||
    virtualenv_command: /usr/bin/python3 -m venv
 | 
			
		||||
    virtualenv_site_packages: true
 | 
			
		||||
  become_user: www-data
 | 
			
		||||
 | 
			
		||||
- name: Create documentation directory with good permissions
 | 
			
		||||
  file:
 | 
			
		||||
    path: /var/www/documentation
 | 
			
		||||
    state: directory
 | 
			
		||||
    owner: www-data
 | 
			
		||||
    group: www-data
 | 
			
		||||
    mode: u=rwx,g=rwxs,o=rx
 | 
			
		||||
 | 
			
		||||
- name: Build HTML documentation
 | 
			
		||||
  command: /var/www/note_kfet/env/bin/sphinx-build -b dirhtml /var/www/note_kfet/docs/ /var/www/documentation/
 | 
			
		||||
  become_user: www-data
 | 
			
		||||
		Reference in New Issue
	
	Block a user