Skip to content

Commit

Permalink
ci(docker): Add support for vue3 www generation
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Nov 28, 2023
1 parent 1321814 commit d238b8c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docker/scripts/generate_www.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
#!/usr/bin/env python

import os
import json
import subprocess

CLIENT_TYPE = os.environ.get("TRAME_CLIENT_TYPE", "vue2")


def run(apps_path, out_path):
# Generate www content
cmd = ["python", "-m", "trame.tools.www", "--output", out_path]
cmd = [
"python",
"-m",
"trame.tools.www",
"--output",
out_path,
"--client-type",
CLIENT_TYPE,
]
subprocess.run(cmd)

# Generate app files index.html => {app_name}.html
Expand All @@ -16,13 +27,16 @@ def run(apps_path, out_path):
for app_name, config in apps_dict.items():
# handle custom modules for www
web_modules = config.get("www_modules")
client_type = config.get("client_type", CLIENT_TYPE)
if web_modules is not None:
cmd = [
"python",
"-m",
"trame.tools.www",
"--output",
out_path,
"--client-type",
client_type,
*web_modules,
]
subprocess.run(cmd)
Expand Down

0 comments on commit d238b8c

Please sign in to comment.