forked from techx/helpqueue
-
Notifications
You must be signed in to change notification settings - Fork 1
/
prebuild.py
33 lines (28 loc) · 1.04 KB
/
prebuild.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import os
import base64
import os.path
from os import path
import os
import base64
print("Post BUILD ENV sync")
if not path.exists(".env"):
print("******* Post build sync started *********")
f = open(".env", "w")
for key in os.environ:
f.write(f"{key}=\"{os.environ[key]}\"\n")
if('GSHEETS_AUTH64' in os.environ):
print("Copying over GSHEETS_AUTH64 as well")
f = open("service_account.json", "wb")
f.write(base64.b64decode(os.environ['GSHEETS_AUTH64']))
f.close()
else:
print("******* WARNING *********")
print("******* Heroku Post Build is current disabled *********")
from server.controllers.settings import *
for setting in ALLDEFAULTSETTINGS:
if (get_setting(None,setting, True) is None):
set_setting(None, setting, "CHANGE ME", override=True)
if (get_setting(None, SETTING_OFFICIAL_MESSAGE, True) is None):
set_setting(None, SETTING_OFFICIAL_MESSAGE, "", override=True)
if (get_setting(None, SETTING_QUEUE_ON, True) is None):
set_setting(None, SETTING_QUEUE_ON, True, override=True)