mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-17 13:55:08 +00:00
tests: set SITES_RULE correctly for https override
This commit is contained in:
parent
80a11fb47f
commit
a69b002881
1 changed files with 9 additions and 1 deletions
|
|
@ -26,11 +26,19 @@ def _add_version_var(name: str, env_path: Path):
|
||||||
def _add_sites_var(env_path: Path):
|
def _add_sites_var(env_path: Path):
|
||||||
with open(env_path, "r+") as f:
|
with open(env_path, "r+") as f:
|
||||||
content = f.read()
|
content = f.read()
|
||||||
|
sites = (
|
||||||
|
"tests.localhost",
|
||||||
|
"test-erpnext-site.localhost",
|
||||||
|
"test-pg-site.localhost",
|
||||||
|
)
|
||||||
|
sites_list = ",".join(f"`{site}`" for site in sites)
|
||||||
|
sites_rule = " || ".join(f"Host(`{site}`)" for site in sites)
|
||||||
content = re.sub(
|
content = re.sub(
|
||||||
rf"SITES=.*",
|
rf"SITES=.*",
|
||||||
f"SITES=`tests.localhost`,`test-erpnext-site.localhost`,`test-pg-site.localhost`",
|
f"SITES={sites_list}",
|
||||||
content,
|
content,
|
||||||
)
|
)
|
||||||
|
content = re.sub(rf"SITES_RULE=.*", f"SITES_RULE={sites_rule}", content)
|
||||||
f.seek(0)
|
f.seek(0)
|
||||||
f.truncate()
|
f.truncate()
|
||||||
f.write(content)
|
f.write(content)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue