2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-11-09 14:50:58 +00:00

fix: link frappe node_modules to make Website Theme work (#702)

* fix: link frappe node_modules to make Website Theme work

* Add website theme test

* Fix failing test

Co-authored-by: Lev Vereshchagin <mail@vrslev.com>
This commit is contained in:
Revant Nandgaonkar 2022-03-16 16:09:16 +05:30 committed by GitHub
parent 51319db0f4
commit 79760daf9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 1 deletions

View File

@ -48,7 +48,10 @@ RUN --mount=type=cache,target=/home/frappe/.cache/pip \
git clone --depth 1 -b ${FRAPPE_VERSION} https://github.com/frappe/frappe apps/frappe \
&& env/bin/pip install -e apps/frappe \
&& env/bin/pip install -U gevent \
&& rm -r apps/frappe/.git
&& rm -r apps/frappe/.git \
# Link Frappe's node_modules/ to make Website Theme work
&& mkdir -p /home/frappe/frappe-bench/sites/assets/frappe/node_modules \
&& ln -s /home/frappe/frappe-bench/sites/assets/frappe/node_modules /home/frappe/frappe-bench/apps/frappe/node_modules

View File

@ -0,0 +1,17 @@
import frappe
def check_website_theme():
doc = frappe.new_doc("Website Theme")
doc.theme = "test theme"
doc.insert()
def main() -> int:
frappe.connect(site="tests")
check_website_theme()
return 0
if __name__ == "__main__":
raise SystemExit(main())

View File

@ -339,6 +339,16 @@ def stop_s3_container():
run("docker", "rm", "minio", "-f")
@log("Check Website Theme creation")
def check_website_theme_creation():
docker_compose("cp", "tests/_check_website_theme.py", "backend:/tmp")
docker_compose_exec(
"backend",
"/home/frappe/frappe-bench/env/bin/python",
"/tmp/_check_website_theme.py",
)
@log("Recreate with HTTPS override")
def recreate_with_https_override():
docker_compose("-f", "overrides/compose.https.yaml", "up", "-d")
@ -456,6 +466,10 @@ def check_s3():
stop_s3_container()
def check_website_theme():
check_website_theme_creation()
def check_https():
print_compose_configuration()
recreate_with_https_override()
@ -485,6 +499,7 @@ def main() -> int:
start()
create_frappe_site_and_check_availability()
check_s3()
check_website_theme()
check_https()
check_erpnext()
check_postgres()