From d22388b04fca0f5653d067fe143f008aba78dc57 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Sun, 4 Oct 2026 03:37:07 +0200 Subject: [PATCH] ci: publish Ravenous assets under assets mount --- ARCHITECTURE.md | 7 +-- FEATURES.md | 5 +- Jenkinsfile | 46 ++++++++----------- README.md | 21 ++++----- TASKS.md | 5 ++ craft_web/AGENTS.md | 8 ++-- craft_web/README.md | 8 ++-- craft_web/TASKS.md | 7 +-- .../schemas/workshop-recipe-v1.schema.json | 2 +- docs/ravenous-craft-v1.schema.json | 2 +- tests/test_build.py | 11 +++++ 11 files changed, 66 insertions(+), 56 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 885fcfb..c3f04d5 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -412,9 +412,10 @@ Branch mapping is: - `lighthouse`: `_lighthouse` review names; - all other branches: archive only. -Every deploy helper resolves against a hard-coded directory allow-list before -using `rsync --delete`. The shared `/mnt/books/RPG` root is never itself a -deletion target. +Every deploy helper resolves against a hard-coded directory allow-list below +`/mnt/assets/ravenous_roll20` before creating the resolved directory and using +`rsync --delete`. The shared project asset root is never itself a deletion +target. This pipeline no longer writes to or removes content from `/mnt/books`. ## Change-impact guide diff --git a/FEATURES.md b/FEATURES.md index aad4b51..751f611 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -558,8 +558,9 @@ directories. explicitly reported optional skip in CI. - Archive all generated bundles and examples. - Deploy production, development, and review branches to distinct allow-listed - paths. Use deletion only inside the resolved product subdirectory; never at - the shared RPG root. + paths below `/mnt/assets/ravenous_roll20`. Create the resolved product + directory when absent. Use deletion only inside that product subdirectory; + never at the shared project asset root. - Other branches build and archive without deployment. **This repository:** `Jenkinsfile` and the three build entry points. diff --git a/Jenkinsfile b/Jenkinsfile index 8336164..e2c9c5d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,11 +9,10 @@ pipeline { BUILD_DIR = 'build' CRAFT_BUILD_DIR = 'craft_web/build' EFFECTS_BUILD_DIR = 'effects_web/build' - DEPLOY_ROOT = '/mnt/books/RPG' + DEPLOY_ROOT = '/mnt/assets/ravenous_roll20' SHEET_DIR = 'ravenous_sheet' CRAFT_DIR = 'ravenous_craft' EFFECTS_DIR = 'ravenous_effects' - LEGACY_DEPLOY_DIR = '/mnt/books/ravenous_sheet' } stages { @@ -156,23 +155,19 @@ pipeline { def devBranches = ['origin/candlelight', 'candlelight'] def productionBranches = ['origin/main', 'main', 'origin/master', 'master'] def targetDir - def legacyDir def craftTargetDir def effectsTargetDir if (reviewBranches.contains(env.BRANCH_NAME)) { targetDir = "${DEPLOY_ROOT}/${SHEET_DIR}_lighthouse" - legacyDir = "${LEGACY_DEPLOY_DIR}_lighthouse" craftTargetDir = "${DEPLOY_ROOT}/${CRAFT_DIR}_lighthouse" effectsTargetDir = "${DEPLOY_ROOT}/${EFFECTS_DIR}_lighthouse" } else if (devBranches.contains(env.BRANCH_NAME)) { targetDir = "${DEPLOY_ROOT}/${SHEET_DIR}_candlelight" - legacyDir = "${LEGACY_DEPLOY_DIR}_candlelight" craftTargetDir = "${DEPLOY_ROOT}/${CRAFT_DIR}_candlelight" effectsTargetDir = "${DEPLOY_ROOT}/${EFFECTS_DIR}_candlelight" } else if (productionBranches.contains(env.BRANCH_NAME)) { targetDir = "${DEPLOY_ROOT}/${SHEET_DIR}" - legacyDir = LEGACY_DEPLOY_DIR craftTargetDir = "${DEPLOY_ROOT}/${CRAFT_DIR}" effectsTargetDir = "${DEPLOY_ROOT}/${EFFECTS_DIR}" } else { @@ -180,7 +175,7 @@ pipeline { return } - deployTo(targetDir, legacyDir) + deployTo(targetDir) deployCraftTo(craftTargetDir) deployEffectsTo(effectsTargetDir) } @@ -224,12 +219,12 @@ pipeline { } } -/** Publish the static reusable-effects library below the shared RPG root. */ +/** Publish the static reusable-effects library below the project asset root. */ def deployEffectsTo(String targetDir) { def allowedDirs = [ - '/mnt/books/RPG/ravenous_effects', - '/mnt/books/RPG/ravenous_effects_candlelight', - '/mnt/books/RPG/ravenous_effects_lighthouse' + '/mnt/assets/ravenous_roll20/ravenous_effects', + '/mnt/assets/ravenous_roll20/ravenous_effects_candlelight', + '/mnt/assets/ravenous_roll20/ravenous_effects_lighthouse' ] if (!allowedDirs.contains(targetDir)) { error("Refusing to publish effects library to unexpected path: ${targetDir}") @@ -243,12 +238,12 @@ def deployEffectsTo(String targetDir) { """ } -/** Publish the static craft workshop below the shared RPG root. */ +/** Publish the static craft workshop below the project asset root. */ def deployCraftTo(String targetDir) { def allowedDirs = [ - '/mnt/books/RPG/ravenous_craft', - '/mnt/books/RPG/ravenous_craft_candlelight', - '/mnt/books/RPG/ravenous_craft_lighthouse' + '/mnt/assets/ravenous_roll20/ravenous_craft', + '/mnt/assets/ravenous_roll20/ravenous_craft_candlelight', + '/mnt/assets/ravenous_roll20/ravenous_craft_lighthouse' ] if (!allowedDirs.contains(targetDir)) { error("Refusing to publish craft workshop to unexpected path: ${targetDir}") @@ -263,15 +258,15 @@ def deployCraftTo(String targetDir) { } -/** Publish under the shared RPG root, then remove this branch's legacy location. */ -def deployTo(String targetDir, String legacyDir) { - def allowedLegacyDirs = [ - '/mnt/books/ravenous_sheet', - '/mnt/books/ravenous_sheet_candlelight', - '/mnt/books/ravenous_sheet_lighthouse' +/** Publish the Roll20 bundle below the project asset root. */ +def deployTo(String targetDir) { + def allowedDirs = [ + '/mnt/assets/ravenous_roll20/ravenous_sheet', + '/mnt/assets/ravenous_roll20/ravenous_sheet_candlelight', + '/mnt/assets/ravenous_roll20/ravenous_sheet_lighthouse' ] - if (!allowedLegacyDirs.contains(legacyDir)) { - error("Refusing to remove unexpected legacy deployment path: ${legacyDir}") + if (!allowedDirs.contains(targetDir)) { + error("Refusing to publish Roll20 sheet to unexpected path: ${targetDir}") } sh """ @@ -280,10 +275,5 @@ def deployTo(String targetDir, String legacyDir) { echo "Publishing Ravenous Roll20 sheet to ${targetDir}" mkdir -p "${targetDir}" rsync -a --delete "${env.BUILD_DIR}/" "${targetDir}/" - - if [ -d "${legacyDir}" ]; then - echo "Removing legacy Ravenous Roll20 sheet from ${legacyDir}" - rm -rf -- "${legacyDir}" - fi """ } diff --git a/README.md b/README.md index 0046cc9..1a98cdf 100644 --- a/README.md +++ b/README.md @@ -360,26 +360,25 @@ Sur l'agent FreeBSD, il vérifie aussi que le Python utilisé par `uv` dispose d convertisseur de monstres en ont besoin. Les branches `main` et `master` sont publiées dans -`/mnt/books/RPG/ravenous_sheet`, correspondant à -`https://books.dandaedre.com/RPG/ravenous_sheet/`. Le dossier `RPG` est partagé -avec les autres feuilles et n'est jamais synchronisé avec `--delete` ; seule la -sous-arborescence Ravenous l'est. Après une publication réussie, Jenkins retire -l'ancien dossier `/mnt/books/ravenous_sheet`. Les branches `candlelight` et -`lighthouse` utilisent respectivement les dossiers suffixés `_candlelight` et -`_lighthouse`, et retirent de la même façon leur ancien dossier suffixé. Les -autres branches sont construites et archivées sans être déployées. +`/mnt/assets/ravenous_roll20/ravenous_sheet`, correspondant à +`https://assets.dandaedre.com/ravenous_roll20/ravenous_sheet/`. Jenkins crée le +dossier cible s'il manque. La racine `ravenous_roll20` n'est jamais synchronisée +avec `--delete` ; seule la sous-arborescence du produit l'est. Les branches +`candlelight` et `lighthouse` utilisent respectivement les dossiers suffixés +`_candlelight` et `_lighthouse`. Les autres branches sont construites et +archivées sans être déployées. Le pipeline ne modifie plus `/mnt/books`. Le pipeline construit également la preuve de concept de l'atelier d'artisanat statique depuis `craft_web/`. Elle est publiée dans -`/mnt/books/RPG/ravenous_craft`, soit -`https://books.dandaedre.com/RPG/ravenous_craft/`, avec les suffixes +`/mnt/assets/ravenous_roll20/ravenous_craft`, soit +`https://assets.dandaedre.com/ravenous_roll20/ravenous_craft/`, avec les suffixes `_candlelight` et `_lighthouse`. Le site ne requiert ni Node.js ni serveur applicatif : Python génère ses fichiers HTML, CSS, JavaScript et son catalogue. La bibliothèque statique d'altérations et d'effets de `effects_web/` suit le même cycle de construction, de test déterministe, d'archivage et de publication. La production est disponible sous -`https://books.dandaedre.com/RPG/ravenous_effects/`; les branches de +`https://assets.dandaedre.com/ravenous_roll20/ravenous_effects/`; les branches de développement et de revue utilisent respectivement les suffixes `_candlelight` et `_lighthouse`. Son catalogue, ses thèmes et son schéma JSON sont générés à partir de la même révision épinglée du livre. diff --git a/TASKS.md b/TASKS.md index 1878ccd..29e5643 100644 --- a/TASKS.md +++ b/TASKS.md @@ -35,6 +35,11 @@ parser, browser, or chat. simulator when Node is available on the build agent. - [x] Generate and archive deterministic forge and alchemy craft fixtures that exercise all four destinations supported by the Roll20 craft importer. +- [x] Move all three Jenkins publication targets from `/mnt/books` to + `/mnt/assets/ravenous_roll20`, keep branch-specific siblings allow-listed, + and create missing product directories. **2026-10-04:** static pipeline + assertions and deterministic build checks pass locally; publication on the + Jenkins agent remains to be observed on the next mapped-branch build. ## Next: Roll20 smoke test diff --git a/craft_web/AGENTS.md b/craft_web/AGENTS.md index 577eb23..c6ad811 100644 --- a/craft_web/AGENTS.md +++ b/craft_web/AGENTS.md @@ -182,10 +182,10 @@ handling, every discipline, recipe validation, filter metadata, export schema, unsafe strings, theme generation, share-size limits, and golden recipes. Jenkins should build and archive the website separately from the Roll20 sheet, -then deploy it to a sibling below `/mnt/books/RPG/` only on the existing -publication branches. Deployment keeps the same allow-list and guarded-delete -discipline used by the sheet. Do not introduce `npm`, `npx`, or network-loaded -assets into CI. +then deploy it to a sibling below `/mnt/assets/ravenous_roll20/` only on the +existing publication branches. Deployment keeps the same allow-list and +guarded-delete discipline used by the sheet. Do not introduce `npm`, `npx`, or +network-loaded assets into CI. ## Change workflow diff --git a/craft_web/README.md b/craft_web/README.md index 4c9cc88..e1377e3 100644 --- a/craft_web/README.md +++ b/craft_web/README.md @@ -10,7 +10,8 @@ The intended implementation is deliberately boring to deploy: - Python 3.11 generates normalized JSON and the static bundle; - the browser application uses dependency-free HTML, CSS, and JavaScript; - no Node.js, application server, database, account, or CDN is required; -- Jenkins can build it on FreeBSD 13 and publish it below `RPG/`; +- Jenkins can build it on FreeBSD 13 and publish it below + `/mnt/assets/ravenous_roll20/`; - recipes work offline and remain on the player's device unless explicitly downloaded, copied, or encoded in a share link/QR code. @@ -36,8 +37,9 @@ uv run python -m unittest discover -s craft_web/tests -v uv run python craft_web/tools/build.py --check ``` -Jenkins publishes production at `/RPG/ravenous_craft/`, with `_candlelight` -and `_lighthouse` siblings for development and review branches. +Jenkins publishes production at +`/mnt/assets/ravenous_roll20/ravenous_craft/`, with `_candlelight` and +`_lighthouse` siblings for development and review branches. ## Proposed user experience diff --git a/craft_web/TASKS.md b/craft_web/TASKS.md index e0fe152..121cb7c 100644 --- a/craft_web/TASKS.md +++ b/craft_web/TASKS.md @@ -39,8 +39,8 @@ remaining phases turn it into a trusted calculator and production application. - [ ] Approve QR contents and limits: encode compact editable recipes, show the approximate QR size, and fall back to download/share text above the tested capacity. Camera scanning is a later enhancement, not MVP. -- [x] Pick the public path. Recommendation: - `/mnt/books/RPG/ravenous_craft/` (`/RPG/ravenous_craft/`) as a sibling of the +- [x] Pick the public path. Current path: + `/mnt/assets/ravenous_roll20/ravenous_craft/` as a sibling of the Roll20 sheet, with branch suffixes matching the existing deployment policy. - [ ] Approve a vendored, license-recorded QR encoder with no CDN/runtime network dependency, or defer QR generation until after the core release. @@ -152,7 +152,8 @@ remaining phases turn it into a trusted calculator and production application. - [x] Extend Jenkins with separate build, test, archive, and guarded deployment steps for the craft site, preserving the existing Roll20 sheet artifacts. - [x] Publish review/development/production branches under the approved sibling - paths below `/mnt/books/RPG/`, with an explicit deployment allow-list. + paths below `/mnt/assets/ravenous_roll20/`, with an explicit deployment + allow-list. - [ ] Perform manual acceptance in current Firefox and Chromium on desktop and mobile-sized viewports: compose each discipline, reload offline, save/restore, share/scan QR, print, export, and import into a controlled Roll20 character. diff --git a/craft_web/schemas/workshop-recipe-v1.schema.json b/craft_web/schemas/workshop-recipe-v1.schema.json index bfc9420..fa4e0aa 100644 --- a/craft_web/schemas/workshop-recipe-v1.schema.json +++ b/craft_web/schemas/workshop-recipe-v1.schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://books.dandaedre.com/RPG/ravenous_craft/workshop-recipe-v1.schema.json", + "$id": "https://assets.dandaedre.com/ravenous_roll20/ravenous_craft/workshop-recipe-v1.schema.json", "title": "Ravenous Workshop editable recipe", "type": "object", "additionalProperties": false, diff --git a/docs/ravenous-craft-v1.schema.json b/docs/ravenous-craft-v1.schema.json index a1096f6..c49ba38 100644 --- a/docs/ravenous-craft-v1.schema.json +++ b/docs/ravenous-craft-v1.schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://books.dandaedre.com/RPG/ravenous_sheet/ravenous-craft-v1.schema.json", + "$id": "https://assets.dandaedre.com/ravenous_roll20/ravenous_sheet/ravenous-craft-v1.schema.json", "title": "Ravenous Roll20 craft exchange", "type": "object", "additionalProperties": false, diff --git a/tests/test_build.py b/tests/test_build.py index c8797f7..cb0020e 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -22,6 +22,17 @@ class BuildTests(unittest.TestCase): "example-monster-2.json", "example-monster-5.json" }) + def test_jenkins_publishes_only_below_project_asset_root(self): + pipeline = (ROOT / "Jenkinsfile").read_text(encoding="utf-8") + deploy_root = "/mnt/assets/ravenous_roll20" + + self.assertIn(f"DEPLOY_ROOT = '{deploy_root}'", pipeline) + self.assertNotIn("/mnt/books", pipeline) + for product in ("ravenous_sheet", "ravenous_craft", "ravenous_effects"): + for suffix in ("", "_candlelight", "_lighthouse"): + self.assertIn(f"'{deploy_root}/{product}{suffix}'", pipeline) + self.assertEqual(3, pipeline.count('mkdir -p "${targetDir}"')) + def test_source_data_was_imported(self): info = json.loads((ROOT / "build/build-info.json").read_text()) self.assertGreaterEqual(info["schools"], 10)