Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,18 @@ def list_str(values):
if args.build:
if os.path.exists(f"{MAGMA_PATH}") and len(os.listdir(MAGMA_PATH)) > 0:
logging.info("Building VueJS front-end.")
subprocess.run(["npm", "install"], cwd=MAGMA_PATH, check=True)
subprocess.run(["npm", "run", "build"], cwd=MAGMA_PATH, check=True)
logging.info("VueJS front-end build complete.")
package_lock = os.path.join(MAGMA_PATH, "package-lock.json")
if os.path.isfile(package_lock):
subprocess.run(["npm", "ci"], cwd=MAGMA_PATH, check=True)
subprocess.run(["npm", "run", "build"], cwd=MAGMA_PATH, check=True)
logging.info("VueJS front-end build complete.")
else:
logging.warning(
f"[bright_yellow]package-lock.json not found at {package_lock}. "
Comment on lines +288 to +295
"A lockfile is required for reproducible builds. "
"Skipping frontend build. Commit package-lock.json or run "
"'npm install' locally to generate it.[/bright_yellow]"
)
Comment on lines +294 to +299
Comment on lines +290 to +299
else:
logging.warning(
f"[bright_yellow]The `--build` flag was supplied, but the Caldera v5 Vue UI is not present."
Expand Down
Loading