2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2025-01-27 00:58:31 +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") @log("Setup .env")
def setup_env(): def setup_env():
shutil.copy("example.env", "tests/.env") shutil.copy("example.env", "tests/.env")
if CI: if not CI:
with open("tests/.env", "a") as f: return
f.write( frappe_version = os.getenv("FRAPPE_VERSION")
f""" if frappe_version == "develop":
FRAPPE_VERSION={os.getenv("FRAPPE_VERSION")} frappe_version = "latest"
ERPNEXT_VERSION={os.getenv("ERPNEXT_VERSION")} 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") @log("Print compose configuration")