add clarifying comments

This commit is contained in:
Elliot Matson 2022-07-30 07:48:07 -05:00 committed by GitHub
parent 6f17429af2
commit 4ba2140b7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,17 +2,24 @@ import json
import os import os
import time import time
# open json file in docker volume
with open("/config/servers.json", "w") as f: with open("/config/servers.json", "w") as f:
print("created " + f.name) print("created " + f.name)
# template json string
template_string = ( template_string = (
'{"Servers": {"1": {"Name": "DavinciResolve", ' '{"Servers": {"1": {"Name": "DavinciResolve", '
'"Group": "Servers", "Port": 5432, "Username": ' '"Group": "Servers", "Port": 5432, "Username": '
'"postgres", "Host": "postgres", "SSLMode": "prefer", "MaintenanceDB": "postgres"}}}' '"postgres", "Host": "postgres", "SSLMode": "prefer", "MaintenanceDB": "postgres"}}}'
) )
data = json.loads(template_string) data = json.loads(template_string)
# fix username
data["Servers"]["1"]["Username"] = os.getenv("POSTGRES_USER") data["Servers"]["1"]["Username"] = os.getenv("POSTGRES_USER")
print("printing json to file...") print("printing json to file...")
print(data) print(data)
# update config file
json.dump(data, f, indent=2) json.dump(data, f, indent=2)
# sleep until GHA Healthchecks are complete # Sleep until GHA Healthchecks are complete.
# I'm sure there's a better way to get this to not
# stall a docker-compose up --wait, but I don't know
# what it is
time.sleep(125) time.sleep(125)