ci: publish Ravenous assets under assets mount

This commit is contained in:
Dandaedre 2026-10-04 03:37:07 +02:00
parent 504bed266d
commit d22388b04f
Signed by: Dandaedre
GPG Key ID: 440C6592E8A26D99
11 changed files with 66 additions and 56 deletions

View File

@ -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

View File

@ -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.

46
Jenkinsfile vendored
View File

@ -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
"""
}

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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,

View File

@ -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,

View File

@ -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)