[ews-build] Use PostgreSQL for ews.webkit.org database
authoraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Mar 2019 21:04:53 +0000 (21:04 +0000)
committeraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Mar 2019 21:04:53 +0000 (21:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196270

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews-app/settings.py:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243518 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/BuildSlaveSupport/ews-app/ews-app/settings.py
Tools/ChangeLog

index 8078787..648b4fe 100644 (file)
@@ -95,12 +95,24 @@ WSGI_APPLICATION = 'ews-app.wsgi.application'
 # Database
 # https://docs.djangoproject.com/en/1.11/ref/settings/#databases
 
-DATABASES = {
-    'default': {
-        'ENGINE': 'django.db.backends.sqlite3',
-        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
+is_test_mode_enabled = os.getenv('EWS_PRODUCTION') is None
+if is_test_mode_enabled:
+    DATABASES = {
+        'default': {
+            'ENGINE': 'django.db.backends.sqlite3',
+            'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
+        }
+    }
+else:
+    DATABASES = {
+        'default': {
+            'ENGINE': 'django.db.backends.postgresql_psycopg2',
+            'NAME': os.environ.get('DB_NAME', None),
+            'USER': os.environ.get('DB_USERNAME', None),
+            'PASSWORD': os.environ.get('DB_PASSWORD', None),
+            'HOST': os.environ.get('DB_URL', None),
+        }
     }
-}
 
 
 # Password validation
index baaa660..1ab1408 100644 (file)
@@ -1,3 +1,12 @@
+2019-03-26  Aakash Jain  <aakash_jain@apple.com>
+
+        [ews-build] Use PostgreSQL for ews.webkit.org database
+        https://bugs.webkit.org/show_bug.cgi?id=196270
+
+        Reviewed by Lucas Forschler.
+
+        * BuildSlaveSupport/ews-app/ews-app/settings.py:
+
 2019-03-26  Jonathan Bedard  <jbedard@apple.com>
 
         [ews] Reset simctl states on reboot