fix(e2e): stale-asset gotcha — rm build wwwroot before copy in e2e-local.sh (+doc)
Build ErsatzTV Image / Build & test (.NET) (pull_request) Failing after 2m45s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Failing after 2s
Build ErsatzTV Image / Docs update reminder (pull_request) Successful in 11s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped

This commit is contained in:
2026-07-10 07:56:34 +02:00
parent 50911eb456
commit 279052ccd4
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -32,8 +32,12 @@ which never runs the app itself).
2. **Copy `wwwroot` into the build output** (the `dotnet build` output directory does not
automatically pick up `web/`'s build artifacts placed directly into the source `wwwroot`):
```bash
rm -rf ErsatzTV/bin/Debug/net10.0/wwwroot
cp -R ErsatzTV/wwwroot ErsatzTV/bin/Debug/net10.0/wwwroot
```
The `rm` matters: if the destination dir already exists (any prior run), `cp -R src dst`
copies **into** it (`dst/wwwroot/...`) and the server silently keeps serving the previous
run's stale assets. `scripts/e2e-local.sh` does the rm+copy for you.
If you rebuild the SPA (`npm run build`) while the dotnet process from step 4 is already
running, **re-copy and then restart the process** — see the "why" note above; it will not pick
up new files live.
+3
View File
@@ -43,6 +43,9 @@ fi
echo "Copying wwwroot into build output (static middleware resolves its file root at startup;" \
"a running process will never see files added later)..."
# rm first: with an existing destination dir, `cp -R src dst` copies INTO it (dst/wwwroot/...),
# silently leaving a previous run's stale assets in place.
rm -rf "$BUILD_DIR/wwwroot"
cp -R "$REPO_ROOT/ErsatzTV/wwwroot" "$BUILD_DIR/wwwroot"
LOG_FILE="$(mktemp)"