From 253da228f70e6f962140cb3ce796473785da2925 Mon Sep 17 00:00:00 2001 From: Elliot Matson Date: Sun, 31 Jul 2022 15:00:39 -0500 Subject: [PATCH] Check if servers.json exists before creating --- pgadmin-config-creator/app.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pgadmin-config-creator/app.py b/pgadmin-config-creator/app.py index 757d995..79667dd 100644 --- a/pgadmin-config-creator/app.py +++ b/pgadmin-config-creator/app.py @@ -2,6 +2,12 @@ import json import os import time +# quit if config file already exists +if os.path.exists("/config/servers.json"): + print("/config/servers.json already exists. Quitting...") + quit() + + # open json file in docker volume with open("/config/servers.json", "w") as f: print("created " + f.name) @@ -18,6 +24,8 @@ with open("/config/servers.json", "w") as f: print(data) # update config file json.dump(data, f, indent=2) + + # 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