Deploy web recommendation index

This commit is contained in:
salman committed 2026-11-19 21:32:24 +01:00
1 parent f672ded04c
commit 54862817a7
2 files changed
+11

No files matched your search

+6
View File
@@ -12,6 +12,7 @@ cgi_target="${MUSRFLOW_CGI_TARGET:-/var/www/cgi-bin/single_musrfit.cgi}"
# outside the web document root so it is never served to browsers.
startup_target="${MUSRFLOW_STARTUP_XML_TARGET:-/var/www/cgi-bin/musrfit_startup.xml}"
docs_source="$project_root/docs/_build/html"
model_index_source="$project_root/assets/model-recommender.js"
# Build as the normal user beforehand, not inside a possibly privileged deploy.
# Check before changing the installed application so missing docs fail cleanly.
@@ -19,6 +20,10 @@ if [ ! -s "$docs_source/index.html" ]; then
printf 'HTML manual missing. Run make -C "%s/docs" html before deploying.\n' "$project_root" >&2
exit 1
fi
if [ ! -s "$model_index_source" ]; then
printf 'Fit recommendation index missing: %s\n' "$model_index_source" >&2
exit 1
fi
# Install only assets used by the browser build. Parameter plotting and ROOT
# rendering are loaded as separate browser modules.
@@ -35,6 +40,7 @@ install -m 0644 \
install -m 0644 \
"$project_root/assets/musrflow-favicon.png" \
"$project_root/assets/musrflow-icon.png" \
"$model_index_source" \
"$web_target/assets/"
# Copy the entire Sphinx site, including search data, styles, and source links.
+5
View File
@@ -74,6 +74,7 @@ function testDocumentationDeployment() {
fs.copyFileSync(path.join(repoRoot, "scripts/deploy-web.sh"), path.join(source, "scripts/deploy-web.sh"));
const assets = ["index.html", "quick-start.html", "ZGUI.css", "muSRFitweb.js", "muSRFitRoot.js",
"muSRFitParameterPlot.js", "muSRFitlib.js", "assets/musrflow-favicon.png", "assets/musrflow-icon.png",
"assets/model-recommender.js",
"cgi/single_musrfit.cgi", "cgi/musrfit_startup.xml"];
for (const file of assets) fs.writeFileSync(path.join(source, file), "fixture\n");
fs.copyFileSync(path.join(repoRoot, "quick-start.html"), path.join(source, "quick-start.html"));
@@ -105,6 +106,10 @@ function testDocumentationDeployment() {
assert.match(installedHelp, /id="musrflowEdition">Web</);
assert.match(installedHelp, /id="musrflowRevision">bbbbbbbbbbbb</);
assert.doesNotMatch(installedHelp, /__MUSRFLOW_|__MUSRFIT_|__ROOT_/);
assert.strictEqual(
fs.readFileSync(path.join(target, "web/assets/model-recommender.js"), "utf8"),
"fixture\n"
);
for (const file of pages) {
const installed = path.join(target, "web/docs", file);
assert.strictEqual(fs.readFileSync(installed, "utf8"), file);