2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2025-01-24 23:58:27 +00:00

Print .env in tests, if version is develop, change to latest (for tag)

This commit is contained in:
Lev Vereshchagin 2021-12-17 12:02:40 +03:00
parent 5780727208
commit 50d569ba27

View File

@ -96,14 +96,23 @@ def docker_compose(*cmd: str):
@log("Setup .env")
def setup_env():
shutil.copy("example.env", "tests/.env")
if CI:
with open("tests/.env", "a") as f:
f.write(
f"""
FRAPPE_VERSION={os.getenv("FRAPPE_VERSION")}
ERPNEXT_VERSION={os.getenv("ERPNEXT_VERSION")}
if not CI:
return
frappe_version = os.getenv("FRAPPE_VERSION")
if frappe_version == "develop":
frappe_version = "latest"
erpnext_version = os.getenv("ERPNEXT_VERSION")
if erpnext_version == "develop":
erpnext_version = "latest"
with open("tests/.env", "a") as f:
f.write(
f"""
FRAPPE_VERSION={frappe_version}
ERPNEXT_VERSION={erpnext_version}
"""
)
)
with open("tests/.env") as f:
print(f.read())
@log("Print compose configuration")