actually call caddyfile script

This commit is contained in:
2025-07-30 22:31:52 -04:00
parent f316d7b79a
commit dce0b13b48
3 changed files with 19 additions and 16 deletions

18
caddy.py Normal file
View File

@@ -0,0 +1,18 @@
from operator import itemgetter
from textwrap import dedent
from deploy import by_branch
def build_caddyfile():
excluded = {"deployer"}
with open("Caddyfile", "w+") as file:
for domain, port in map(itemgetter("domain", "port"), by_branch.values()):
if domain in excluded:
continue
entry = f"""
{domain}.drm.dev {{
reverse_proxy localhost:{port}
}}
"""
file.write(dedent(entry))