Skip to content

Commit

Permalink
Check if servers.json exists before creating
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotmatson committed Jul 31, 2022
1 parent b59b16c commit 253da22
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pgadmin-config-creator/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
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)
Expand All @@ -18,6 +24,8 @@
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
Expand Down

0 comments on commit 253da22

Please sign in to comment.