[odrs-web] Set SQLALCHEMY_DATABASE_URI when deploying



commit 0d3ea7e21a1b2984d874a7e5a5f02032b8b5d759
Author: Richard Hughes <richard hughsie com>
Date:   Fri Jun 28 15:04:37 2019 +0100

    Set SQLALCHEMY_DATABASE_URI when deploying

 app_data/httpd-cfg/odrs.gnome.org.conf | 4 +---
 app_data/httpd-pre-init/entrypoint.sh  | 4 +---
 app_data/wsgi-scripts/odrs.wsgi        | 4 +---
 3 files changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/app_data/httpd-cfg/odrs.gnome.org.conf b/app_data/httpd-cfg/odrs.gnome.org.conf
index 9750057..664341d 100644
--- a/app_data/httpd-cfg/odrs.gnome.org.conf
+++ b/app_data/httpd-cfg/odrs.gnome.org.conf
@@ -16,9 +16,7 @@
     WSGIScriptAlias / /opt/app-root/src/wsgi-scripts/odrs.wsgi
 
     SetEnv ODRS_REVIEWS_SECRET replace_odrs_secret
-    SetEnv MYSQL_DB_USERNAME replace_odrs_username
-    SetEnv MYSQL_DB_PASSWORD replace_odrs_password
-    SetEnv MYSQL_DB_HOST replace_odrs_host
+    SetEnv SQLALCHEMY_DATABASE_URI replace_odrs_database_uri
 
     <Location /static/>
         ExpiresActive On
diff --git a/app_data/httpd-pre-init/entrypoint.sh b/app_data/httpd-pre-init/entrypoint.sh
index 62eedcf..588eca9 100755
--- a/app_data/httpd-pre-init/entrypoint.sh
+++ b/app_data/httpd-pre-init/entrypoint.sh
@@ -1,8 +1,6 @@
 #!/bin/sh
 
 sed -i "s/replace_odrs_secret/${ODRS_REVIEWS_SECRET}/" ${HTTPD_CONFIGURATION_PATH}/odrs.gnome.org.conf 
-sed -i "s/replace_odrs_username/${MYSQL_DB_USERNAME}/" ${HTTPD_CONFIGURATION_PATH}/odrs.gnome.org.conf
-sed -i "s/replace_odrs_password/${MYSQL_DB_PASSWORD}/" ${HTTPD_CONFIGURATION_PATH}/odrs.gnome.org.conf
-sed -i "s/replace_odrs_host/${MYSQL_DB_HOST}/" ${HTTPD_CONFIGURATION_PATH}/odrs.gnome.org.conf
+sed -i "s/replace_odrs_database_uri/${SQLALCHEMY_DATABASE_URI}/" 
${HTTPD_CONFIGURATION_PATH}/odrs.gnome.org.conf
 
 while true; do python36 /opt/app-root/src/cron.py ratings /opt/app-root/src/odrs/static/ratings.json ; sleep 
43200 ; done &
diff --git a/app_data/wsgi-scripts/odrs.wsgi b/app_data/wsgi-scripts/odrs.wsgi
index 158bca7..93a78df 100644
--- a/app_data/wsgi-scripts/odrs.wsgi
+++ b/app_data/wsgi-scripts/odrs.wsgi
@@ -11,9 +11,7 @@ import os
 sys.path.insert(0, os.environ['ODRS_HOME'])
 
 def application(environ, start_response):
-    for key in ['MYSQL_DB_HOST',
-                'MYSQL_DB_USERNAME',
-                'MYSQL_DB_PASSWORD',
+    for key in ['SQLALCHEMY_DATABASE_URI',
                 'ODRS_REVIEWS_SECRET']:
         os.environ[key] = environ[key]
     from odrs import app as _application


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]