first version of deploy script + set version to 0.1.0
authorymh <ymh.work@gmail.com>
Fri, 30 Nov 2018 14:49:19 +0100
changeset 184 aac6db7cea99
parent 183 f8f3af9e5c83
child 185 c8678091a837
first version of deploy script + set version to 0.1.0
deploy/deploy.yml
deploy/group_vars/group_vars.yml.tmpl
deploy/templates/nginx.static.conf.j2
src/irinotes/__init__.py
--- a/deploy/deploy.yml	Fri Nov 30 10:53:15 2018 +0100
+++ b/deploy/deploy.yml	Fri Nov 30 14:49:19 2018 +0100
@@ -105,7 +105,7 @@
         chdir: "{{client_dir}}"
       environment:
         REACT_APP_API_ROOT_URL: "{{backend_base_url}}"
-        REACT_APP_BASENAME: "{{backend_base_url}}"
+        REACT_APP_BASENAME: "{{static_url_base}}"
         REACT_APP_NETWORK_STATUS_INTERVAL: "{{network_status_interval}}"
         REACT_APP_NETWORK_STATUS_TIMEOUT: "{{network_status_timeout}}"
         REACT_APP_SYNC_INTERVAL: "{{sync_interval}}"
--- a/deploy/group_vars/group_vars.yml.tmpl	Fri Nov 30 10:53:15 2018 +0100
+++ b/deploy/group_vars/group_vars.yml.tmpl	Fri Nov 30 14:49:19 2018 +0100
@@ -18,6 +18,9 @@
 # static file domain
 static_server_name: ""
 
+# static url base
+static_url_base: ""
+
 # Remote static nginx service
 static_http_service: "nginx"
 
--- a/deploy/templates/nginx.static.conf.j2	Fri Nov 30 10:53:15 2018 +0100
+++ b/deploy/templates/nginx.static.conf.j2	Fri Nov 30 14:49:19 2018 +0100
@@ -30,15 +30,15 @@
         include /etc/nginx/uwsgi_params;
     }
 
-    location /backend/static {
+    location {{'/' if static_url_base=='' else static_url_base}}backend/static {
         alias {{backend_nginx_static_root}}; # backend static files
     }
 
-    location /backend/media {
+    location {{'/' if static_url_base=='' else static_url_base}}backend/media {
         alias {{backend_nginx_media_root}};  # backend media files
     }
 
-    location / {
+    location {{'/' if static_url_base=='' else static_url_base}} {
         # First attempt to serve request as file, then
         # as directory, then fall back to displaying a 404.
         try_files $uri $uri/ /index.html;
--- a/src/irinotes/__init__.py	Fri Nov 30 10:53:15 2018 +0100
+++ b/src/irinotes/__init__.py	Fri Nov 30 14:49:19 2018 +0100
@@ -1,5 +1,4 @@
-VERSION = (0, 0, 1, "final", 0)
-
+VERSION = (0, 1, 0, 'final', 0)
 VERSION_STR = ".".join(map(lambda i:"%02d" % (i,), VERSION[:2]))
 
 ###